* Clipping src and crtc rectangles for SetCrtc and SetPlane
@ 2014-12-04 20:27 Adam Cheney
2014-12-04 21:04 ` Ville Syrjälä
0 siblings, 1 reply; 3+ messages in thread
From: Adam Cheney @ 2014-12-04 20:27 UTC (permalink / raw)
To: dri-devel@lists.freedesktop.org
[-- Attachment #1.1: Type: text/plain, Size: 1305 bytes --]
Hi dri-devel,
I have a question about validating the user specified rectangles in SetCrtc and SetPlane.
To me this is required for src_ or crtc_ rectangles to be legal, true for both SetCrtc and SetPlane:
1) src_{x,y,w,h} fits entirely within the fb size
2) crtc_{x,y,w,h} fits entirely within the mode size
There is some common code that enforces 1), but 2) appears to be up to individual drivers to enforce (if they choose to) as far as I can tell.
If the crtc_ output rectangle extends outside of the connector's active mode, should DRM drivers perform the mode clipping themselves, or should this be considered an application bug and an error code returned?
Is there any reason not to enforce 2) in the core DRM code, rather than in the individual drivers?
Thanks,
-Adam
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
[-- Attachment #1.2: Type: text/html, Size: 5956 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Clipping src and crtc rectangles for SetCrtc and SetPlane
2014-12-04 20:27 Clipping src and crtc rectangles for SetCrtc and SetPlane Adam Cheney
@ 2014-12-04 21:04 ` Ville Syrjälä
2014-12-04 21:22 ` Adam Cheney
0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjälä @ 2014-12-04 21:04 UTC (permalink / raw)
To: Adam Cheney; +Cc: dri-devel@lists.freedesktop.org
On Thu, Dec 04, 2014 at 08:27:41PM +0000, Adam Cheney wrote:
> Hi dri-devel,
>
> I have a question about validating the user specified rectangles in SetCrtc and SetPlane.
>
> To me this is required for src_ or crtc_ rectangles to be legal, true for both SetCrtc and SetPlane:
>
>
> 1) src_{x,y,w,h} fits entirely within the fb size
>
> 2) crtc_{x,y,w,h} fits entirely within the mode size
>
> There is some common code that enforces 1), but 2) appears to be up to individual drivers to enforce (if they choose to) as far as I can tell.
>
> If the crtc_ output rectangle extends outside of the connector's active mode, should DRM drivers perform the mode clipping themselves, or should this be considered an application bug and an error code returned?
>
> Is there any reason not to enforce 2) in the core DRM code, rather than in the individual drivers?
We clip the crtc_ coords rather than require that they fit inside the crtc.
It's a bug for the driver not to do that as far as I'm concerned.
Since we do have sub-pixel src coordinates we could have required the crtc_
coordinates to stay within the crtc limits without losing functionality, but
allowing them to extend outside made it easier to write test code, and gave
me a nice excuse to push the drm_rect stuff ;)
--
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread* RE: Clipping src and crtc rectangles for SetCrtc and SetPlane
2014-12-04 21:04 ` Ville Syrjälä
@ 2014-12-04 21:22 ` Adam Cheney
0 siblings, 0 replies; 3+ messages in thread
From: Adam Cheney @ 2014-12-04 21:22 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: dri-devel@lists.freedesktop.org
> -----Original Message-----
> From: Ville Syrjälä [mailto:ville.syrjala@linux.intel.com]
> Sent: Thursday, December 04, 2014 4:05 PM
> To: Adam Cheney
> Cc: dri-devel@lists.freedesktop.org
> Subject: Re: Clipping src and crtc rectangles for SetCrtc and SetPlane
>
> On Thu, Dec 04, 2014 at 08:27:41PM +0000, Adam Cheney wrote:
> > Hi dri-devel,
> >
> > I have a question about validating the user specified rectangles in SetCrtc and
> SetPlane.
> >
> > To me this is required for src_ or crtc_ rectangles to be legal, true for both
> SetCrtc and SetPlane:
> >
> >
> > 1) src_{x,y,w,h} fits entirely within the fb size
> >
> > 2) crtc_{x,y,w,h} fits entirely within the mode size
> >
> > There is some common code that enforces 1), but 2) appears to be up to
> individual drivers to enforce (if they choose to) as far as I can tell.
> >
> > If the crtc_ output rectangle extends outside of the connector's active mode,
> should DRM drivers perform the mode clipping themselves, or should this be
> considered an application bug and an error code returned?
> >
> > Is there any reason not to enforce 2) in the core DRM code, rather than in the
> individual drivers?
>
> We clip the crtc_ coords rather than require that they fit inside the crtc.
> It's a bug for the driver not to do that as far as I'm concerned.
>
> Since we do have sub-pixel src coordinates we could have required the crtc_
> coordinates to stay within the crtc limits without losing functionality, but
> allowing them to extend outside made it easier to write test code, and gave me
> a nice excuse to push the drm_rect stuff ;)
>
> --
> Ville Syrjälä
> Intel OTC
Thanks! This is also my feeling. It's make DRM easier to use if the drivers perform the clipping rather than producing an error, or even worse just pushing the invalid request to the hardware.
-Adam
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information. Any unauthorized review, use, disclosure or distribution
is prohibited. If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-12-04 21:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-04 20:27 Clipping src and crtc rectangles for SetCrtc and SetPlane Adam Cheney
2014-12-04 21:04 ` Ville Syrjälä
2014-12-04 21:22 ` Adam Cheney
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.