Skip to content

Commit 9f8d4fe

Browse files
committed
drm/pl111: Make the default BPP a per-variant variable
The PL110, Integrator and Versatile boards strongly prefer to use 16 BPP even if other modes are supported, both to keep down memory consumption and also to easier find a good match to supported resolutions with consideration taken to the memory bandwidth of the platforms. Reviewed-by: Eric Anholt <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent afe09e4 commit 9f8d4fe

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

drivers/gpu/drm/pl111/pl111_drm.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ struct drm_minor;
4343
* @broken_vblank: the vblank IRQ is broken on this variant
4444
* @formats: array of supported pixel formats on this variant
4545
* @nformats: the length of the array of supported pixel formats
46+
* @fb_bpp: desired bits per pixel on the default framebuffer
4647
*/
4748
struct pl111_variant_data {
4849
const char *name;
@@ -52,6 +53,7 @@ struct pl111_variant_data {
5253
bool broken_vblank;
5354
const u32 *formats;
5455
unsigned int nformats;
56+
unsigned int fb_bpp;
5557
};
5658

5759
struct pl111_drm_dev_private {

drivers/gpu/drm/pl111/pl111_drv.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int pl111_modeset_init(struct drm_device *dev)
192192

193193
drm_mode_config_reset(dev);
194194

195-
drm_fb_cma_fbdev_init(dev, 32, 0);
195+
drm_fb_cma_fbdev_init(dev, priv->variant->fb_bpp, 0);
196196

197197
drm_kms_helper_poll_init(dev);
198198

@@ -336,6 +336,7 @@ static const struct pl111_variant_data pl110_variant = {
336336
.is_pl110 = true,
337337
.formats = pl110_pixel_formats,
338338
.nformats = ARRAY_SIZE(pl110_pixel_formats),
339+
.fb_bpp = 16,
339340
};
340341

341342
/* RealView, Versatile Express etc use this modern variant */
@@ -360,6 +361,7 @@ static const struct pl111_variant_data pl111_variant = {
360361
.name = "PL111",
361362
.formats = pl111_pixel_formats,
362363
.nformats = ARRAY_SIZE(pl111_pixel_formats),
364+
.fb_bpp = 32,
363365
};
364366

365367
static const struct amba_id pl111_id_table[] = {

drivers/gpu/drm/pl111/pl111_versatile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ static const struct pl111_variant_data pl110_integrator = {
241241
.broken_vblank = true,
242242
.formats = pl110_integrator_pixel_formats,
243243
.nformats = ARRAY_SIZE(pl110_integrator_pixel_formats),
244+
.fb_bpp = 16,
244245
};
245246

246247
/*
@@ -253,6 +254,7 @@ static const struct pl111_variant_data pl110_versatile = {
253254
.external_bgr = true,
254255
.formats = pl110_versatile_pixel_formats,
255256
.nformats = ARRAY_SIZE(pl110_versatile_pixel_formats),
257+
.fb_bpp = 16,
256258
};
257259

258260
int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)

0 commit comments

Comments
 (0)