diff mbox

[v2,6/6] drm/omap: Allow wider display when a virtual plane is available

Message ID 20180326162128.8740-7-bparrot@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Benoit Parrot March 26, 2018, 4:21 p.m. UTC
Add an exception case when filtering out display mode so that if
a virtual wide plane is available then display wider than 2048 can be
supported as long as the required timing parameters can also be met.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_connector.c |  3 ++-
 drivers/gpu/drm/omapdrm/omap_plane.c     | 12 ++++++++++++
 drivers/gpu/drm/omapdrm/omap_plane.h     |  1 +
 3 files changed, 15 insertions(+), 1 deletion(-)

Comments

Tomi Valkeinen April 5, 2018, 10:40 a.m. UTC | #1
On 26/03/18 19:21, Benoit Parrot wrote:
> Add an exception case when filtering out display mode so that if
> a virtual wide plane is available then display wider than 2048 can be
> supported as long as the required timing parameters can also be met.
> 
> Signed-off-by: Benoit Parrot <bparrot@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_connector.c |  3 ++-
>  drivers/gpu/drm/omapdrm/omap_plane.c     | 12 ++++++++++++
>  drivers/gpu/drm/omapdrm/omap_plane.h     |  1 +
>  3 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
> index d5e059abb555..517f7fa80ce1 100644
> --- a/drivers/gpu/drm/omapdrm/omap_connector.c
> +++ b/drivers/gpu/drm/omapdrm/omap_connector.c
> @@ -203,7 +203,8 @@ static int omap_connector_mode_valid(struct drm_connector *connector,
>  		u16 width, height;
>  
>  		priv->dispc_ops->ovl_get_max_size(&width, &height);
> -		if (mode->hdisplay > width)
> +		if (mode->hdisplay > width &&
> +		    !omap_have_any_virtual_plane(dev))

This doesn't sound correct. It's not whether we have any virtual planes,
but whether we have virtual planes for this display.

 Tomi
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_connector.c b/drivers/gpu/drm/omapdrm/omap_connector.c
index d5e059abb555..517f7fa80ce1 100644
--- a/drivers/gpu/drm/omapdrm/omap_connector.c
+++ b/drivers/gpu/drm/omapdrm/omap_connector.c
@@ -203,7 +203,8 @@  static int omap_connector_mode_valid(struct drm_connector *connector,
 		u16 width, height;
 
 		priv->dispc_ops->ovl_get_max_size(&width, &height);
-		if (mode->hdisplay > width)
+		if (mode->hdisplay > width &&
+		    !omap_have_any_virtual_plane(dev))
 			r = -EINVAL;
 	}
 
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 21c927bbf5a7..8529abdcdeb8 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -209,6 +209,18 @@  bool is_omap_plane_virtual(struct drm_plane *plane)
 	return omap_plane->virtual_plane;
 }
 
+bool omap_have_any_virtual_plane(struct drm_device *dev)
+{
+	struct drm_plane *plane;
+
+	drm_for_each_plane(plane, dev) {
+		if (is_omap_plane_virtual(plane))
+			return true;
+	}
+
+	return false;
+}
+
 /* helper to install properties which are common to planes and crtcs */
 void omap_plane_install_properties(struct drm_plane *plane,
 		struct drm_mode_object *obj)
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.h b/drivers/gpu/drm/omapdrm/omap_plane.h
index 48815a05f4fe..86b1c2022231 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.h
+++ b/drivers/gpu/drm/omapdrm/omap_plane.h
@@ -35,5 +35,6 @@  struct drm_plane *omap_plane_init(struct drm_device *dev,
 void omap_plane_install_properties(struct drm_plane *plane,
 		struct drm_mode_object *obj);
 bool is_omap_plane_virtual(struct drm_plane *plane);
+bool omap_have_any_virtual_plane(struct drm_device *dev);
 
 #endif /* __OMAPDRM_PLANE_H__ */