aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2018-03-02 04:09:45 -0500
committerLinus Walleij <linus.walleij@linaro.org>2018-03-07 16:46:46 -0500
commit9f8d4fe94eb4fb958fc92ee91a3ec54ab378339c (patch)
tree124a6c28994a9ded622e0d3da0108494721fc122
parentafe09e43b4000503a50a20577d44e16050ccf6ca (diff)
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 <eric@anholt.net> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20180302090948.6399-2-linus.walleij@linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20180307084316.23623-1-linus.walleij@linaro.org Link: https://patchwork.freedesktop.org/patch/msgid/20180307084316.23623-1-linus.walleij@linaro.org
-rw-r--r--drivers/gpu/drm/pl111/pl111_drm.h2
-rw-r--r--drivers/gpu/drm/pl111/pl111_drv.c4
-rw-r--r--drivers/gpu/drm/pl111/pl111_versatile.c2
3 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index 8e252b561e2c..2a93e0134061 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -43,6 +43,7 @@ struct drm_minor;
43 * @broken_vblank: the vblank IRQ is broken on this variant 43 * @broken_vblank: the vblank IRQ is broken on this variant
44 * @formats: array of supported pixel formats on this variant 44 * @formats: array of supported pixel formats on this variant
45 * @nformats: the length of the array of supported pixel formats 45 * @nformats: the length of the array of supported pixel formats
46 * @fb_bpp: desired bits per pixel on the default framebuffer
46 */ 47 */
47struct pl111_variant_data { 48struct pl111_variant_data {
48 const char *name; 49 const char *name;
@@ -52,6 +53,7 @@ struct pl111_variant_data {
52 bool broken_vblank; 53 bool broken_vblank;
53 const u32 *formats; 54 const u32 *formats;
54 unsigned int nformats; 55 unsigned int nformats;
56 unsigned int fb_bpp;
55}; 57};
56 58
57struct pl111_drm_dev_private { 59struct pl111_drm_dev_private {
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index a7a3a49956c5..e92a406c9ea9 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -192,7 +192,7 @@ static int pl111_modeset_init(struct drm_device *dev)
192 192
193 drm_mode_config_reset(dev); 193 drm_mode_config_reset(dev);
194 194
195 drm_fb_cma_fbdev_init(dev, 32, 0); 195 drm_fb_cma_fbdev_init(dev, priv->variant->fb_bpp, 0);
196 196
197 drm_kms_helper_poll_init(dev); 197 drm_kms_helper_poll_init(dev);
198 198
@@ -336,6 +336,7 @@ static const struct pl111_variant_data pl110_variant = {
336 .is_pl110 = true, 336 .is_pl110 = true,
337 .formats = pl110_pixel_formats, 337 .formats = pl110_pixel_formats,
338 .nformats = ARRAY_SIZE(pl110_pixel_formats), 338 .nformats = ARRAY_SIZE(pl110_pixel_formats),
339 .fb_bpp = 16,
339}; 340};
340 341
341/* RealView, Versatile Express etc use this modern variant */ 342/* RealView, Versatile Express etc use this modern variant */
@@ -360,6 +361,7 @@ static const struct pl111_variant_data pl111_variant = {
360 .name = "PL111", 361 .name = "PL111",
361 .formats = pl111_pixel_formats, 362 .formats = pl111_pixel_formats,
362 .nformats = ARRAY_SIZE(pl111_pixel_formats), 363 .nformats = ARRAY_SIZE(pl111_pixel_formats),
364 .fb_bpp = 32,
363}; 365};
364 366
365static const struct amba_id pl111_id_table[] = { 367static const struct amba_id pl111_id_table[] = {
diff --git a/drivers/gpu/drm/pl111/pl111_versatile.c b/drivers/gpu/drm/pl111/pl111_versatile.c
index 05a4b89e0934..2c6fc50b0c12 100644
--- a/drivers/gpu/drm/pl111/pl111_versatile.c
+++ b/drivers/gpu/drm/pl111/pl111_versatile.c
@@ -241,6 +241,7 @@ static const struct pl111_variant_data pl110_integrator = {
241 .broken_vblank = true, 241 .broken_vblank = true,
242 .formats = pl110_integrator_pixel_formats, 242 .formats = pl110_integrator_pixel_formats,
243 .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats), 243 .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats),
244 .fb_bpp = 16,
244}; 245};
245 246
246/* 247/*
@@ -253,6 +254,7 @@ static const struct pl111_variant_data pl110_versatile = {
253 .external_bgr = true, 254 .external_bgr = true,
254 .formats = pl110_versatile_pixel_formats, 255 .formats = pl110_versatile_pixel_formats,
255 .nformats = ARRAY_SIZE(pl110_versatile_pixel_formats), 256 .nformats = ARRAY_SIZE(pl110_versatile_pixel_formats),
257 .fb_bpp = 16,
256}; 258};
257 259
258int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv) 260int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)