diff mbox series

[22/24] drm/omap: fix maximum sizes

Message ID 1518428694-18018-23-git-send-email-tomi.valkeinen@ti.com
State Superseded
Headers show
Series drm/omap: misc patches | expand

Commit Message

Tomi Valkeinen Feb. 12, 2018, 9:44 a.m. UTC
We define max width and height in mode_config to 2048. These maximums
affect many things, which are independent and depend on platform. We
need to do more fine grained checks in the code paths for each
component, and so the maximum values in mode_config should just be "big
enough" to cover all use cases.

Change the maximum width & height to 8192.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

Comments

Laurent Pinchart Feb. 27, 2018, 1:42 p.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Monday, 12 February 2018 11:44:52 EET Tomi Valkeinen wrote:
> We define max width and height in mode_config to 2048. These maximums
> affect many things, which are independent and depend on platform. We
> need to do more fine grained checks in the code paths for each
> component, and so the maximum values in mode_config should just be "big
> enough" to cover all use cases.
> 
> Change the maximum width & height to 8192.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/omap_drv.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c
> b/drivers/gpu/drm/omapdrm/omap_drv.c index 5a27a47b628e..2df125369781
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_drv.c
> +++ b/drivers/gpu/drm/omapdrm/omap_drv.c
> @@ -412,11 +412,14 @@ static int omap_modeset_init(struct drm_device *dev)
>  	dev->mode_config.min_width = 8;
>  	dev->mode_config.min_height = 2;
> 
> -	/* note: eventually will need some cpu_is_omapXYZ() type stuff here
> -	 * to fill in these limits properly on different OMAP generations..
> +	/*
> +	 * Note: these values are used for multiple independent things:
> +	 * connector mode filtering, buffer sizes, crtc sizes...
> +	 * Use big enough values here to cover all use cases, and do more
> +	 * specific checking in the respective code paths.
>  	 */
> -	dev->mode_config.max_width = 2048;
> -	dev->mode_config.max_height = 2048;
> +	dev->mode_config.max_width = 8192;
> +	dev->mode_config.max_height = 8192;

This makes me ponder on the usefulness of the max_width and max_height fields. 
If we end up having to set them to very large values so they don't get in the 
way, and implement independent checks manually, the fields should then be 
split into finer-grained parameters to make DRM core checks useful.

>  	dev->mode_config.funcs = &omap_mode_config_funcs;
>  	dev->mode_config.helper_private = &omap_mode_config_helper_funcs;
Tomi Valkeinen Feb. 28, 2018, 9:10 a.m. UTC | #2
On 27/02/18 15:42, Laurent Pinchart wrote:

>> +	/*
>> +	 * Note: these values are used for multiple independent things:
>> +	 * connector mode filtering, buffer sizes, crtc sizes...
>> +	 * Use big enough values here to cover all use cases, and do more
>> +	 * specific checking in the respective code paths.
>>  	 */
>> -	dev->mode_config.max_width = 2048;
>> -	dev->mode_config.max_height = 2048;
>> +	dev->mode_config.max_width = 8192;
>> +	dev->mode_config.max_height = 8192;
> 
> This makes me ponder on the usefulness of the max_width and max_height fields. 
> If we end up having to set them to very large values so they don't get in the 
> way, and implement independent checks manually, the fields should then be 
> split into finer-grained parameters to make DRM core checks useful.

I agree.

 Tomi
diff mbox series

Patch

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 5a27a47b628e..2df125369781 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -412,11 +412,14 @@  static int omap_modeset_init(struct drm_device *dev)
 	dev->mode_config.min_width = 8;
 	dev->mode_config.min_height = 2;
 
-	/* note: eventually will need some cpu_is_omapXYZ() type stuff here
-	 * to fill in these limits properly on different OMAP generations..
+	/*
+	 * Note: these values are used for multiple independent things:
+	 * connector mode filtering, buffer sizes, crtc sizes...
+	 * Use big enough values here to cover all use cases, and do more
+	 * specific checking in the respective code paths.
 	 */
-	dev->mode_config.max_width = 2048;
-	dev->mode_config.max_height = 2048;
+	dev->mode_config.max_width = 8192;
+	dev->mode_config.max_height = 8192;
 
 	dev->mode_config.funcs = &omap_mode_config_funcs;
 	dev->mode_config.helper_private = &omap_mode_config_helper_funcs;