All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Adam Cheney <acheney@nvidia.com>
Cc: "dri-devel@lists.freedesktop.org" <dri-devel@lists.freedesktop.org>
Subject: Re: Clipping src and crtc rectangles for SetCrtc and SetPlane
Date: Thu, 4 Dec 2014 23:04:50 +0200	[thread overview]
Message-ID: <20141204210450.GH10649@intel.com> (raw)
In-Reply-To: <abc52b36511d49419d5e757c6894840c@HQMAIL107.nvidia.com>

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

  reply	other threads:[~2014-12-04 21:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-04 20:27 Clipping src and crtc rectangles for SetCrtc and SetPlane Adam Cheney
2014-12-04 21:04 ` Ville Syrjälä [this message]
2014-12-04 21:22   ` Adam Cheney

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=20141204210450.GH10649@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=acheney@nvidia.com \
    --cc=dri-devel@lists.freedesktop.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.