<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=us-ascii"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
{font-family:Latha;
panose-1:2 0 4 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Courier New";}
span.k
{mso-style-name:k;}
span.p
{mso-style-name:p;}
span.n
{mso-style-name:n;}
span.o
{mso-style-name:o;}
span.s
{mso-style-name:s;}
span.se
{mso-style-name:se;}
span.nf
{mso-style-name:nf;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hello All, <o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'>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. <o:p></o:p></p><p class=MsoNormal style='text-indent:.5in'><o:p> </o:p></p><p class=MsoNormal style='text-indent:.5in'>If my understanding is incorrect, could somehow explain the motivation behind having these checks here?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks and Regards,<o:p></o:p></p><p class=MsoNormal>Jeykumar S.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>[1] <a href="https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/drm_framebuffer.c?h=v5.3#n303">https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/drm_framebuffer.c?h=v5.3#n303</a><o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><pre style='background:white'><span class=k><b><span style='color:#008800'>struct</span></b></span><span style='color:black'> <span class=n>drm_framebuffer</span> <span class=o>*</span><o:p></o:p></span></pre><pre style='background:white'><span class=nf><b><span style='color:#0066BB'>drm_internal_framebuffer_create</span></b></span><span class=p><span style='color:black'>(</span></span><span class=k><b><span style='color:#008800'>struct</span></b></span><span style='color:black'> <span class=n>drm_device</span> <span class=o>*</span><span class=n>dev</span><span class=p>,</span><o:p></o:p></span></pre><pre style='background:white'><span style='color:black'> </span><span class=k><b><span style='color:#008800'>const</span></b></span><span style='color:black'> </span><span class=k><b><span style='color:#008800'>struct</span></b></span><span style='color:black'> <span class=n>drm_mode_fb_cmd2</span> <span class=o>*</span><span class=n>r</span><span class=p>,</span><o:p></o:p></span></pre><pre style='background:white'><span style='color:black'> </span><span class=k><b><span style='color:#008800'>struct</span></b></span><span style='color:black'> <span class=n>drm_file</span> <span class=o>*</span><span class=n>file_priv</span><span class=p>)</span><o:p></o:p></span></pre><pre style='background:white'><span class=p><span style='color:black'>{</span></span><span style='color:black'><o:p></o:p></span></pre><p class=MsoNormal> /* snip */<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#008800'>if</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> ((config->min_width > r->width) || (r->width > config->max_width)) {<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> DRM_DEBUG_KMS(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#DD2200;background:#FFF0F0'>"bad framebuffer width %d, should be >= %d && <= %d</span><span style='font-size:10.0pt;font-family:"Courier New";color:#0044DD;background:#FFF0F0'>\n</span><span style='font-size:10.0pt;font-family:"Courier New";color:#DD2200;background:#FFF0F0'>"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> r->width, config->min_width, config->max_width);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#008800'>return</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> ERR_PTR(-EINVAL);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> }<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#008800'>if</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> ((config->min_height > r->height) || (r->height > config->max_height)) {<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> DRM_DEBUG_KMS(</span><span style='font-size:10.0pt;font-family:"Courier New";color:#DD2200;background:#FFF0F0'>"bad framebuffer height %d, should be >= %d && <= %d</span><span style='font-size:10.0pt;font-family:"Courier New";color:#0044DD;background:#FFF0F0'>\n</span><span style='font-size:10.0pt;font-family:"Courier New";color:#DD2200;background:#FFF0F0'>"</span><span style='font-size:10.0pt;font-family:"Courier New";color:black'>,<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> r->height, config->min_height, config->max_height);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> </span><b><span style='font-size:10.0pt;font-family:"Courier New";color:#008800'>return</span></b><span style='font-size:10.0pt;font-family:"Courier New";color:black'> ERR_PTR(-EINVAL);<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> }<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'> /* snip */<o:p></o:p></span></p><p class=MsoNormal style='background:white'><span style='font-size:10.0pt;font-family:"Courier New";color:black'>}<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p></div></body></html>