[PATCH 29/36] drm/omap: fix max fb width
Tomi Valkeinen
tomi.valkeinen at ti.com
Wed Nov 30 11:17:31 UTC 2016
Maximum framebuffer width on OMAP5+ DSS is 4096, instead of 2048. This
patch makes omapdrm ask the respective dispc for the limits.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen at ti.com>
---
drivers/gpu/drm/omapdrm/dss/dispc.c | 9 +++++++++
drivers/gpu/drm/omapdrm/dss/omapdss.h | 1 +
drivers/gpu/drm/omapdrm/omap_drv.c | 11 +++++++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index 9034b97240db..1db64edbbbfd 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -4148,6 +4148,14 @@ static void dispc_free_irq(void *dev_id)
dispc.user_data = NULL;
}
+static void dispc_get_min_max_size(u32 *min_w, u32 *min_h, u32 *max_w, u32 *max_h)
+{
+ *min_w = 8;
+ *min_h = 2;
+ *max_w = dispc.feat->mgr_width_max;
+ *max_h = dispc.feat->mgr_height_max;
+}
+
/*
* Workaround for errata i734 in DSS dispc
* - LCD1 Gamma Correction Is Not Working When GFX Pipe Is Disabled
@@ -4321,6 +4329,7 @@ static const struct dispc_ops dispc_ops = {
.get_num_ovls = dispc_get_num_ovls,
.get_num_mgrs = dispc_get_num_mgrs,
+ .get_min_max_size = dispc_get_min_max_size,
.mgr_enable = dispc_mgr_enable,
.mgr_is_enabled = dispc_mgr_is_enabled,
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 74cba1ef7ee9..8d04b02a7d35 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -906,6 +906,7 @@ struct dispc_ops {
int (*get_num_ovls)(void);
int (*get_num_mgrs)(void);
+ void (*get_min_max_size)(u32 *min_w, u32 *min_h, u32 *max_w, u32 *max_h);
void (*mgr_enable)(enum omap_channel channel, bool enable);
bool (*mgr_is_enabled)(enum omap_channel channel);
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index eecf8649c0f7..f53343c24335 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -315,6 +315,7 @@ static int omap_modeset_init(struct drm_device *dev)
int num_crtcs;
int i, id = 0;
int ret;
+ u32 min_w, min_h, max_w, max_h;
drm_mode_config_init(dev);
@@ -475,14 +476,16 @@ static int omap_modeset_init(struct drm_device *dev)
priv->num_planes, priv->num_crtcs, priv->num_encoders,
priv->num_connectors);
- dev->mode_config.min_width = 8;
- dev->mode_config.min_height = 2;
+ priv->dispc_ops->get_min_max_size(&min_w, &min_h, &max_w, &max_h);
+
+ dev->mode_config.min_width = min_w;
+ dev->mode_config.min_height = min_h;
/* note: eventually will need some cpu_is_omapXYZ() type stuff here
* to fill in these limits properly on different OMAP generations..
*/
- dev->mode_config.max_width = 2048;
- dev->mode_config.max_height = 2048;
+ dev->mode_config.max_width = max_w;
+ dev->mode_config.max_height = max_h;
dev->mode_config.funcs = &omap_mode_config_funcs;
--
2.7.4
More information about the dri-devel
mailing list