public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: shobhit.kumar@intel.com, akash.goel@intel.com,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 6/6] drm/i915: New drm crtc property for varying the Crtc size
Date: Thu, 14 Aug 2014 18:45:33 +0300	[thread overview]
Message-ID: <20140814154533.GH4193@intel.com> (raw)
In-Reply-To: <20140814152626.GV10500@phenom.ffwll.local>

On Thu, Aug 14, 2014 at 05:26:27PM +0200, Daniel Vetter wrote:
> On Thu, Aug 14, 2014 at 06:06:58PM +0300, Ville Syrjälä wrote:
> > On Thu, Aug 14, 2014 at 04:42:01PM +0200, Daniel Vetter wrote:
> > > On Thu, Aug 14, 2014 at 02:54:27PM +0530, akash.goel@intel.com wrote:
> > > > From: Akash Goel <akash.goel@intel.com>
> > > > +		/* Check if the current FB is compatible with new requested
> > > > +		   Pipesrc values by the User */
> > > > +		if (new_width > fb->width ||
> > > > +			new_height > fb->height ||
> > > > +			crtc->x > fb->width - new_width ||
> > > > +			crtc->y > fb->height - new_height) {
> > > > +			DRM_DEBUG_KMS("New Pipe Src values %dx%d is incompatible with current fb size & viewport %ux%u+%d+%d\n",
> > > > +			      new_width, new_height, fb->width, fb->height, crtc->x, crtc->y);
> > > > +			return -EINVAL;
> > > > +		}
> > > 
> > > I think this part here is the achilles heel of your approach. Right now we
> > > use crtc->mode.hdisplay/vdisplay
> > 
> > We don't use it in i915. If we do that's a bug. All the relevant places
> > should be loooking at pipe_src_{w,h}. In the core the viewport check
> > should be about the only place that cares about this stuff.
> 
> Well within i915, but not anywhere in the drm core or helper code since
> they're simply not aware of pipe_src_w/h. E.g. the plane helper code also
> uses crtc->mode.h/vdisplay.

My quick grep audit tells me the viewport check and
drm_primary_helper_update() are the only places in the core that care.
The latter is rather dubious anyway since the clipping should be done
against the adjusted mode and not the user specified mode, so anyone
using that is already dancing on thin ice.

The other drivers are something I would not touch. Given how many places
we had to frob in i915 I'm somewhat sure I'd not like what I see there
and then any patch I might cook up would be too half assed to satisfy my
quality standards anyway.

As far as always filling the crtc->w,h always goes, I'm not sure that's
the best idea anyway since we still need the "0 is special" handling.
Well, we could fill them out, but then we definitely need a flag or
something to indicate that they came from the mode and not the
properties, so that we know whether we should overwrite them from
with {h,v}display during a subsquent modeset or if they should keep
their current value.

-- 
Ville Syrjälä
Intel OTC

  parent reply	other threads:[~2014-08-14 15:46 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-14  9:24 [PATCH 0/6] New drm crtc property for varying the Crtc size akash.goel
2014-08-14  9:24 ` [PATCH 1/6] drm/i915: Added a return type for panel fitter config functions akash.goel
2014-08-14  9:24 ` [PATCH 2/6] drm/i915: Added a return type for the restore crtc mode function akash.goel
2014-08-14  9:24 ` [PATCH 3/6] drm/i915: Added Max down-scale ratio checks when enabling Panel fitter akash.goel
2014-08-14  9:24 ` [PATCH 4/6] drm/i915: Added support to allow change in FB pitch across flips akash.goel
2014-08-14 14:27   ` Daniel Vetter
2014-08-14  9:24 ` [PATCH 5/6] Documentation/drm: Describing crtc size property akash.goel
2014-08-14  9:24 ` [PATCH 6/6] drm/i915: New drm crtc property for varying the Crtc size akash.goel
2014-08-14 14:42   ` Daniel Vetter
2014-08-14 15:06     ` Ville Syrjälä
2014-08-14 15:26       ` Daniel Vetter
2014-08-14 15:32         ` Ville Syrjälä
2014-08-14 15:45         ` Ville Syrjälä [this message]
2014-08-14 16:07           ` Daniel Vetter
2014-08-14 16:45             ` Ville Syrjälä
2014-08-14 17:36               ` Daniel Vetter
2014-08-14 17:58                 ` Ville Syrjälä
2014-08-14 18:33                   ` Daniel Vetter
2014-08-14 18:51                     ` Ville Syrjälä
2014-08-14 15:32 ` [PATCH 0/6] " Damien Lespiau

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=20140814154533.GH4193@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=akash.goel@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shobhit.kumar@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox