Linux-ARM-MSM Archive on lore.kernel.org
 help / color / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: jsanka@codeaurora.org, dri-devel@lists.freedesktop.org,
	freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org
Cc: sean@poorly.run, 'Sean Paul' <seanpaul@chromium.org>
Subject: Re: [RFC] checking drm_framebuffer against config width/height
Date: Thu, 19 Sep 2019 08:44:05 +0200
Message-ID: <db26145b-3f64-a334-f698-76f972332881@baylibre.com> (raw)
In-Reply-To: <09ee01d56e9a$a2739380$e75aba80$@codeaurora.org>

Hi,

On 19/09/2019 05:30, jsanka@codeaurora.org wrote:
> Hello All,
> 
> I bumped into the below check [1] enforced in drm_framebuffer creation which checks the requested framebuffer width/height parameters against the drm mode config width/height limits. As I understand, drm_mode_config: min/max width/height indicate the upper and lower bounds of the display panel (drm_connector) resolutions the DRM device can support. But the pixel processing pipeline can apply cropping/scaling transformations on much larger input framebuffers and flip the buffers within the display resolution. Such configurations are very common and the final resolution will be still within drm_mode_config bounds. So I believe the checks should be relaxed / removed from the drm_framebuffer creation api’s.
> 
>  
> 
> If my understanding is incorrect, could somehow explain the motivation behind having these checks here?

I already reported this a few months ago, here is the log of the discussion :
https://patchwork.kernel.org/patch/10625707/

TL;DR it should be removed but these checks should be moved to control max screen size
in atomic_commit paths.

I planned to fix this, but haven't found time yet...

Neil

> 
>  
> 
> Thanks and Regards,
> 
> Jeykumar S.
> 
>  
> 
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/drm_framebuffer.c?h=v5.3#n303
> 
>  
> 
> *struct*drm_framebuffer *
> 
> *drm_internal_framebuffer_create*(*struct*drm_device *dev,
> 
>                                *const**struct*drm_mode_fb_cmd2 *r,
> 
>                                *struct*drm_file *file_priv)
> 
> {
> 
>                      /* snip */
> 
>  
> 
>         *if*((config->min_width > r->width) || (r->width > config->max_width)) {
> 
>                DRM_DEBUG_KMS("bad framebuffer width %d, should be >= %d && <= %d\n",
> 
>                          r->width, config->min_width, config->max_width);
> 
>                *return*ERR_PTR(-EINVAL);
> 
>         }
> 
>         *if*((config->min_height > r->height) || (r->height > config->max_height)) {
> 
>                DRM_DEBUG_KMS("bad framebuffer height %d, should be >= %d && <= %d\n",
> 
>                          r->height, config->min_height, config->max_height);
> 
>                *return*ERR_PTR(-EINVAL);
> 
>         }
> 
>         /* snip */
> 
> }
> 
>  
> 
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
> 


           reply index

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <09ee01d56e9a$a2739380$e75aba80$@codeaurora.org>]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=db26145b-3f64-a334-f698-76f972332881@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jsanka@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=sean@poorly.run \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-ARM-MSM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-msm/0 linux-arm-msm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-msm linux-arm-msm/ https://lore.kernel.org/linux-arm-msm \
		linux-arm-msm@vger.kernel.org
	public-inbox-index linux-arm-msm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-arm-msm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git