gma500: psbfb_create(): move depth initialization out of loop
authorKirill A. Shutemov <kirill.shutemov@linux.intel.com>
Thu, 8 Mar 2012 16:02:36 +0000 (16:02 +0000)
committerDave Airlie <airlied@redhat.com>
Sat, 10 Mar 2012 13:05:50 +0000 (13:05 +0000)
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/gma500/framebuffer.c

index 110fcad4c1245772c838db3315cf6dc06b8e7075..b4710dc8d27f10447c6f7374faabb4464c2535b1 100644 (file)
@@ -391,6 +391,7 @@ static int psbfb_create(struct psb_fbdev *fbdev,
        mode_cmd.width = sizes->surface_width;
        mode_cmd.height = sizes->surface_height;
        bpp = sizes->surface_bpp;
+       depth = sizes->surface_depth;
 
        /* No 24bit packed */
        if (bpp == 24)
@@ -403,7 +404,6 @@ static int psbfb_create(struct psb_fbdev *fbdev,
                 * is ok with some fonts
                 */
                mode_cmd.pitches[0] =  ALIGN(mode_cmd.width * ((bpp + 7) / 8), 4096 >> pitch_lines);
-               depth = sizes->surface_depth;
 
                size = mode_cmd.pitches[0] * mode_cmd.height;
                size = ALIGN(size, PAGE_SIZE);