dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Russell King - ARM Linux <linux@armlinux.org.uk>
To: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: "David Airlie" <airlied@linux.ie>,
	"DRI devel" <dri-devel@lists.freedesktop.org>,
	"Mali DP Maintainers" <malidp@foss.arm.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Brian Starkey" <brian.starkey@arm.com>,
	LAKML <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/3] drm/arm: hdlcd: properly validate plane state
Date: Fri, 31 Mar 2017 13:21:17 +0100	[thread overview]
Message-ID: <20170331122117.GS7909@n2100.armlinux.org.uk> (raw)
In-Reply-To: <20170331114130.GG13355@e110455-lin.cambridge.arm.com>

On Fri, Mar 31, 2017 at 12:41:30PM +0100, Liviu Dudau wrote:
> On Fri, Mar 31, 2017 at 11:27:51AM +0100, Russell King - ARM Linux wrote:
> > On Fri, Mar 31, 2017 at 11:23:45AM +0100, Liviu Dudau wrote:
> > > On Fri, Mar 31, 2017 at 11:20:35AM +0100, Russell King - ARM Linux wrote:
> > > > On Fri, Mar 31, 2017 at 11:18:50AM +0100, Liviu Dudau wrote:
> > > > > Hi Russell,
> > > > > 
> > > > > You were Cc-ed in a patch from March 8th that did all this:
> > > > > 
> > > > > https://lists.freedesktop.org/archives/dri-devel/2017-March/135172.html
> > > > 
> > > > I'm aware of that (you may notice that this was threaded to that patch.)
> > > > 
> > > > > I have not received any response from you, so I have already pushed the
> > > > > patch in my public repo:
> > > > > 
> > > > > git://linux-arm.org/linux-ld.git for-upstream/hdlcd
> > > > > 
> > > > > It has been included into linux-next for at least a couple of weeks now.
> > > > 
> > > > I've not had a chance to test any of this, but I believe that your
> > > > patch does not fully address the issue, due to bits missing from
> > > > the validation path.
> > > 
> > > Care to point out which bits were missing from my patch that are in yours?
> > 
> > The visible check?
> 
> A plane's ->atomic_check() hook can be called with TEST_ONLY to figure out from
> userspace if the given configuration is a valid one that can be accepted by
> the hardware. There should be no error if the plane will not be visible, as we
> are not programming anything yet.
> 
> I would also argue that the test that you remove and replace with state->visible
> is important. We can't do *any* scaling, while with your patch we could accept
> src_w != crtc_w as long as it is visible. Hardware is not capable of handling that.

That's what the "DRM_PLANE_HELPER_NO_SCALING" arguments to
drm_plane_helper_check_state() are doing:

	drm_plane_helper_check_state()
		drm_rect_calc_hscale()

		        if (hscale < min_hscale || hscale > max_hscale)
                		return -ERANGE;

		drm_rect_calc_vscale()

		        if (vscale < min_vscale || vscale > max_vscale)
                		return -ERANGE;

where DRM_PLANE_HELPER_NO_SCALING is 1.0 in 16:16 format.  So, this
ensures that the scaling factor is 1.0, returning -ERANGE if it isn't.

If this lets through a scaled source, then there's a bug that needs
fixing in the helper.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

  reply	other threads:[~2017-03-31 12:21 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 23:37 [BUG] hdlcd gets confused about base address Russell King - ARM Linux
2016-11-21  9:44 ` Daniel Vetter
2016-11-21 11:06 ` Liviu Dudau
2016-11-21 11:20   ` Russell King - ARM Linux
2016-11-21 11:32     ` Liviu Dudau
2016-11-21 12:25       ` Russell King - ARM Linux
2016-11-21 12:56         ` Liviu Dudau
2016-11-21 13:24           ` Russell King - ARM Linux
2016-11-21 13:50             ` Liviu Dudau
2016-11-21 14:03               ` Russell King - ARM Linux
2016-11-21 17:32                 ` Liviu Dudau
2016-11-21 17:56                   ` Russell King - ARM Linux
2016-11-21 18:16                     ` Russell King - ARM Linux
2016-11-21 18:25                       ` Liviu Dudau
2016-11-21 18:23                     ` Liviu Dudau
2016-11-21 18:43                       ` Russell King - ARM Linux
2016-11-21 14:30             ` Russell King - ARM Linux
2016-11-21 14:55               ` Russell King - ARM Linux
2016-11-22  7:02                 ` Daniel Vetter
2017-02-20 12:16 ` Russell King - ARM Linux
2017-02-20 17:53   ` Liviu Dudau
2017-02-20 17:57     ` Russell King - ARM Linux
2017-02-20 18:05     ` Ville Syrjälä
2017-02-20 18:59       ` Russell King - ARM Linux
2017-02-22 15:42         ` Ville Syrjälä
2017-02-26 19:31           ` Daniel Vetter
2017-02-22 15:15       ` Liviu Dudau
2017-02-22 15:30         ` Ville Syrjälä
2017-03-08 16:30           ` [PATCH v2] drm: hdlcd: Fix the calculation of the scanout start address Liviu Dudau
2017-03-31  9:49             ` Russell King - ARM Linux
2017-03-31  9:51               ` [PATCH 1/3] drm/arm: hdlcd: properly validate plane state Russell King
2017-03-31 10:18                 ` Liviu Dudau
2017-03-31 10:20                   ` Russell King - ARM Linux
2017-03-31 10:23                     ` Liviu Dudau
2017-03-31 10:27                       ` Russell King - ARM Linux
2017-03-31 11:41                         ` Liviu Dudau
2017-03-31 12:21                           ` Russell King - ARM Linux [this message]
2017-03-31  9:51               ` [PATCH 2/3] drm/arm: hdlcd: fix plane base address calculation Russell King
2017-03-31 13:13                 ` Liviu Dudau
2017-03-31  9:51               ` [PATCH 3/3] drm/arm: hdlcd: check for rotation Russell King
2017-03-31 10:11                 ` Ville Syrjälä
2017-03-31 10:21                   ` Liviu Dudau
2017-03-31 13:18               ` [PATCH v2] drm: hdlcd: Fix the calculation of the scanout start address Liviu Dudau
2017-03-31 13:48                 ` Russell King - ARM Linux
2017-04-03 10:31                   ` Liviu Dudau
2017-04-03 13:13                     ` Russell King - ARM Linux
2017-04-03 14:07                       ` Liviu Dudau
2017-04-06 11:07                       ` Jani Nikula

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=20170331122117.GS7909@n2100.armlinux.org.uk \
    --to=linux@armlinux.org.uk \
    --cc=Liviu.Dudau@arm.com \
    --cc=airlied@linux.ie \
    --cc=brian.starkey@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=malidp@foss.arm.com \
    --cc=ville.syrjala@linux.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;
as well as URLs for NNTP newsgroup(s).