Commit 9f8d4fe9 authored by Linus Walleij's avatar Linus Walleij

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: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarLinus 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
parent afe09e43
...@@ -43,6 +43,7 @@ struct drm_minor; ...@@ -43,6 +43,7 @@ struct drm_minor;
* @broken_vblank: the vblank IRQ is broken on this variant * @broken_vblank: the vblank IRQ is broken on this variant
* @formats: array of supported pixel formats on this variant * @formats: array of supported pixel formats on this variant
* @nformats: the length of the array of supported pixel formats * @nformats: the length of the array of supported pixel formats
* @fb_bpp: desired bits per pixel on the default framebuffer
*/ */
struct pl111_variant_data { struct pl111_variant_data {
const char *name; const char *name;
...@@ -52,6 +53,7 @@ struct pl111_variant_data { ...@@ -52,6 +53,7 @@ struct pl111_variant_data {
bool broken_vblank; bool broken_vblank;
const u32 *formats; const u32 *formats;
unsigned int nformats; unsigned int nformats;
unsigned int fb_bpp;
}; };
struct pl111_drm_dev_private { struct pl111_drm_dev_private {
......
...@@ -192,7 +192,7 @@ static int pl111_modeset_init(struct drm_device *dev) ...@@ -192,7 +192,7 @@ static int pl111_modeset_init(struct drm_device *dev)
drm_mode_config_reset(dev); drm_mode_config_reset(dev);
drm_fb_cma_fbdev_init(dev, 32, 0); drm_fb_cma_fbdev_init(dev, priv->variant->fb_bpp, 0);
drm_kms_helper_poll_init(dev); drm_kms_helper_poll_init(dev);
...@@ -336,6 +336,7 @@ static const struct pl111_variant_data pl110_variant = { ...@@ -336,6 +336,7 @@ static const struct pl111_variant_data pl110_variant = {
.is_pl110 = true, .is_pl110 = true,
.formats = pl110_pixel_formats, .formats = pl110_pixel_formats,
.nformats = ARRAY_SIZE(pl110_pixel_formats), .nformats = ARRAY_SIZE(pl110_pixel_formats),
.fb_bpp = 16,
}; };
/* RealView, Versatile Express etc use this modern variant */ /* RealView, Versatile Express etc use this modern variant */
...@@ -360,6 +361,7 @@ static const struct pl111_variant_data pl111_variant = { ...@@ -360,6 +361,7 @@ static const struct pl111_variant_data pl111_variant = {
.name = "PL111", .name = "PL111",
.formats = pl111_pixel_formats, .formats = pl111_pixel_formats,
.nformats = ARRAY_SIZE(pl111_pixel_formats), .nformats = ARRAY_SIZE(pl111_pixel_formats),
.fb_bpp = 32,
}; };
static const struct amba_id pl111_id_table[] = { static const struct amba_id pl111_id_table[] = {
......
...@@ -241,6 +241,7 @@ static const struct pl111_variant_data pl110_integrator = { ...@@ -241,6 +241,7 @@ static const struct pl111_variant_data pl110_integrator = {
.broken_vblank = true, .broken_vblank = true,
.formats = pl110_integrator_pixel_formats, .formats = pl110_integrator_pixel_formats,
.nformats = ARRAY_SIZE(pl110_integrator_pixel_formats), .nformats = ARRAY_SIZE(pl110_integrator_pixel_formats),
.fb_bpp = 16,
}; };
/* /*
...@@ -253,6 +254,7 @@ static const struct pl111_variant_data pl110_versatile = { ...@@ -253,6 +254,7 @@ static const struct pl111_variant_data pl110_versatile = {
.external_bgr = true, .external_bgr = true,
.formats = pl110_versatile_pixel_formats, .formats = pl110_versatile_pixel_formats,
.nformats = ARRAY_SIZE(pl110_versatile_pixel_formats), .nformats = ARRAY_SIZE(pl110_versatile_pixel_formats),
.fb_bpp = 16,
}; };
int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv) int pl111_versatile_init(struct device *dev, struct pl111_drm_dev_private *priv)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment