From: <jsanka-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>
To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org,
'Rob Clark' <robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
'Sean Paul' <seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: [RFC] checking drm_framebuffer against config width/height
Date: Wed, 18 Sep 2019 20:30:49 -0700 [thread overview]
Message-ID: <09ee01d56e9a$a2739380$e75aba80$@codeaurora.org> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 1869 bytes --]
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?
Thanks and Regards,
Jeykumar S.
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/driv
ers/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 */
}
[-- Attachment #1.2: Type: text/html, Size: 10149 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Freedreno mailing list
Freedreno@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/freedreno
next reply other threads:[~2019-09-19 3:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-19 3:30 jsanka-sgV2jX0FEOL9JmXXK+q4OQ [this message]
2019-09-19 6:44 ` [RFC] checking drm_framebuffer against config width/height Neil Armstrong
2019-09-19 6:44 ` Neil Armstrong
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='09ee01d56e9a$a2739380$e75aba80$@codeaurora.org' \
--to=jsanka-sgv2jx0feol9jmxxk+q4oq@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=freedreno-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-arm-msm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=robdclark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=sean-p7yTbzM4H96eqtR555YLDQ@public.gmane.org \
--cc=seanpaul-F7+t8E8rja9g9hUCZPvPmw@public.gmane.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.