Skip to content

Commit d816acb

Browse files
committed
video: bcm2708_fb: Fixups based on review comments
Signed-off-by: Dave Stevenson <[email protected]>
1 parent e91617d commit d816acb

File tree

1 file changed

+11
-27
lines changed

1 file changed

+11
-27
lines changed

drivers/video/fbdev/bcm2708_fb.c

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,9 @@ static int bcm2708_fb_set_par(struct fb_info *info)
288288
.xoffset = info->var.xoffset,
289289
.yoffset = info->var.yoffset,
290290
.tag5 = { RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE, 8, 0 },
291-
.base = 0,
292-
.screen_size = 0,
291+
/* base and screen_size will be initialised later */
293292
.tag6 = { RPI_FIRMWARE_FRAMEBUFFER_SET_PITCH, 4, 0 },
294-
.pitch = 0,
293+
/* pitch will be initialised later */
295294
};
296295
int ret, image_size;
297296

@@ -316,7 +315,7 @@ static int bcm2708_fb_set_par(struct fb_info *info)
316315
}
317316

318317
fb->cpuaddr = dma_alloc_coherent(info->device, image_size,
319-
&fb->dma_addr, GFP_ATOMIC);
318+
&fb->dma_addr, GFP_KERNEL);
320319

321320
if (!fb->cpuaddr) {
322321
fb->dma_addr = 0;
@@ -354,29 +353,14 @@ static int bcm2708_fb_set_par(struct fb_info *info)
354353
}
355354

356355
if (ret) {
357-
/* Old scheme */
358-
const struct fb_alloc_tags fbinfo_old = {
359-
.tag1 = { RPI_FIRMWARE_FRAMEBUFFER_SET_PHYSICAL_WIDTH_HEIGHT,
360-
8, 0, },
361-
.xres = info->var.xres,
362-
.yres = info->var.yres,
363-
.tag2 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_WIDTH_HEIGHT,
364-
8, 0, },
365-
.xres_virtual = info->var.xres_virtual,
366-
.yres_virtual = info->var.yres_virtual,
367-
.tag3 = { RPI_FIRMWARE_FRAMEBUFFER_SET_DEPTH, 4, 0 },
368-
.bpp = info->var.bits_per_pixel,
369-
.tag4 = { RPI_FIRMWARE_FRAMEBUFFER_SET_VIRTUAL_OFFSET,
370-
8, 0 },
371-
.xoffset = info->var.xoffset,
372-
.yoffset = info->var.yoffset,
373-
.tag5 = { RPI_FIRMWARE_FRAMEBUFFER_ALLOCATE, 8, 0 },
374-
.base = 0,
375-
.screen_size = 0,
376-
.tag6 = { RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH, 4, 0 },
377-
.pitch = 0,
378-
};
379-
fbinfo = fbinfo_old;
356+
/* Old scheme:
357+
* - FRAMEBUFFER_ALLOCATE passes 0 for base and screen_size.
358+
* - GET_PITCH instead of SET_PITCH.
359+
*/
360+
fbinfo.base = 0;
361+
fbinfo.screen_size = 0;
362+
fbinfo.tag6.tag = RPI_FIRMWARE_FRAMEBUFFER_GET_PITCH;
363+
fbinfo.pitch = 0;
380364

381365
ret = rpi_firmware_property_list(fb->fw, &fbinfo,
382366
sizeof(fbinfo));

0 commit comments

Comments
 (0)