All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3 2/4] drm: Add drm_rect_calc_{hscale, vscale}() utility functions
Date: Tue, 16 Apr 2013 18:16:10 +0300	[thread overview]
Message-ID: <20130416151610.GL4469@intel.com> (raw)
In-Reply-To: <20130416144958.GE13387@cantiga.alporthouse.com>

On Tue, Apr 16, 2013 at 03:49:58PM +0100, Chris Wilson wrote:
> On Tue, Apr 16, 2013 at 05:14:14PM +0300, Ville Syrjälä wrote:
> > On Tue, Apr 16, 2013 at 02:42:34PM +0100, Chris Wilson wrote:
> > > On Tue, Apr 16, 2013 at 01:47:20PM +0300, ville.syrjala@linux.intel.com wrote:
> > > > diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> > > > index 2b7278c..de24f16 100644
> > > > --- a/include/drm/drm_rect.h
> > > > +++ b/include/drm/drm_rect.h
> > > > @@ -128,5 +128,17 @@ bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip);
> > > >  bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst,
> > > >  			  const struct drm_rect *clip,
> > > >  			  int hscale, int vscale);
> > > > +int drm_rect_calc_hscale(const struct drm_rect *src,
> > > > +			 const struct drm_rect *dst,
> > > > +			 int min_hscale, int max_hscale);
> > > > +int drm_rect_calc_vscale(const struct drm_rect *src,
> > > > +			 const struct drm_rect *dst,
> > > > +			 int min_vscale, int max_vscale);
> > > > +int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
> > > > +				 struct drm_rect *dst,
> > > > +				 int min_hscale, int max_hscale);
> > > > +int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
> > > > +				 struct drm_rect *dst,
> > > > +				 int min_vscale, int max_vscale);
> > > 
> > > These struct drm_rect *src should be const so it is clear that dst is
> > > being manipulated.
> > 
> > Actually they can manipulate either src or dst, depending on whether
> > we're trying upscale or downscale too much. The idea being that we
> > can only decrease the size of either rect, never increase.
> 
> Hmm, ofc you are right.  I guess I'm just not that comfortable with the
> concept of relaxed scaling.

Yeah it's a bit of an open question how we should do things. The
hardware constraints can be very complicated to describe, so I
don't see any simple/sane way to report them to userspace. Which
means writing simple hardware agnostic userspace code is pretty
much impossible unless the kernel is very relaxed about what it
accepts.

OTOH if you want to be sure that the final picture will look
exactly as specified, then you'd probably want an error
instead.

But I haven't really made up my mind on how we should handle those two
cases. Some kind of control knob might be nice, but I've not yet figured
out where the knob should live, and what kind of granularity it should
have.

And then we also have the problem that our errno based error reporting
isn't really adequate for figuring out why something failed. Usually
you just have to enable drm debugs, try again, and read through the log.

> Dare I ask you to split patch 4 so that you
> can convince me with a solid changelog?

So you'd like me to implement strict checks first, and then relax them
in a follow up patch?

> 
> s/calculcated/calculated.

Fixed. Thanks.

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2013-04-16 15:16 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-16 10:47 [PATCH] drm: drm_rect and clipping for intel sprite planes ville.syrjala
2013-04-16 10:47 ` [PATCH v5 1/4] drm: Add struct drm_rect and assorted utility functions ville.syrjala
2013-04-16 10:47 ` [PATCH v3 2/4] drm: Add drm_rect_calc_{hscale, vscale}() " ville.syrjala
2013-04-16 13:42   ` Chris Wilson
2013-04-16 14:14     ` Ville Syrjälä
2013-04-16 14:49       ` Chris Wilson
2013-04-16 15:16         ` Ville Syrjälä [this message]
2013-04-16 15:27           ` Chris Wilson
2013-04-19  8:04             ` [PATCH 1/3] drm: Add drm_rect_equals() ville.syrjala
2013-04-19  8:04               ` [PATCH v4 2/3] drm/i915: Implement proper clipping for video sprites ville.syrjala
2013-04-19  8:04               ` [PATCH 3/3] drm/i915: Relax the sprite scaling limits checks ville.syrjala
2013-04-16 10:47 ` [PATCH v3 3/4] drm: Add drm_rect_debug_print() ville.syrjala
2013-04-16 10:47 ` [PATCH v3 4/4] drm/i915: Implement proper clipping for video sprites ville.syrjala
2013-04-16 13:37   ` Chris Wilson
2013-04-16 14:20     ` Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2013-03-27 15:46 [PATCH v3 1/4] drm: Add struct drm_rect and assorted utility functions ville.syrjala
2013-03-27 15:46 ` [PATCH v3 2/4] drm: Add drm_rect_calc_{hscale, vscale}() " ville.syrjala

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=20130416151610.GL4469@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@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.