From: Boris Brezillon <boris.brezillon@bootlin.com>
To: Eric Anholt <eric@anholt.net>
Cc: David Airlie <airlied@linux.ie>, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/vc4: Use drm_atomic_helper_check_plane_state() to simplify the logic
Date: Fri, 27 Jul 2018 22:54:49 +0200 [thread overview]
Message-ID: <20180727225449.30f03175@bbrezillon> (raw)
In-Reply-To: <87effo1kjz.fsf@anholt.net>
On Fri, 27 Jul 2018 13:38:08 -0700
Eric Anholt <eric@anholt.net> wrote:
> Boris Brezillon <boris.brezillon@bootlin.com> writes:
>
> > From: Eric Anholt <eric@anholt.net>
> >
> > drm_atomic_helper_check_plane_state() takes care of checking the
> > scaling capabilities and calculating the clipped X/Y offsets for us.
> >
> > Rely on this function instead of open-coding the logic. While at it, we
> > get rid of a few fields in vc4_plane_state that can be easily extracted
> > from drm_plane_state.
> >
> > Incidentally, it seems to fix a problem we had with negative X/Y
> > positioning of YUV planes.
> >
> > Signed-off-by: Eric Anholt <eric@anholt.net>
> > Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
> > ---
> > drivers/gpu/drm/vc4/vc4_drv.h | 9 --
> > drivers/gpu/drm/vc4/vc4_plane.c | 210 +++++++++++++++++++++-------------------
> > 2 files changed, 111 insertions(+), 108 deletions(-)
>
> I feel like you ought to grab authorship of this patch -- you've made a
> bunch of good changes since my WIP patch.
>
> > if (num_planes > 1) {
> > - vc4_state->is_yuv = true;
> > -
> > - h_subsample = drm_format_horz_chroma_subsampling(format);
> > - v_subsample = drm_format_vert_chroma_subsampling(format);
> > - vc4_state->src_w[1] = vc4_state->src_w[0] / h_subsample;
> > - vc4_state->src_h[1] = vc4_state->src_h[0] / v_subsample;
> > + src_w /= h_subsample;
> > + src_h /= v_subsample;
>
> I'm a little nervous about leaving src_w/src_h divided after this block,
> in case we end up using them in some other calculation in a later
> change. Could we just move the divide into the vc4_get_scaling_mode()
> call?
>
> In general, I'm not enthusiastic about having src_w computations in 5
> places now. Was keeping it in the vc4 state that much of a problem?
No strong objection to keeping ->src_{h,w}[] arrays in vc4_plane_state.
>
> I'm not saying no, but copy-and-paste of these kinds of calculations are
> also a frequent source of bugs when you miss a x->y or w->h change.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-07-27 20:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-25 15:32 [PATCH 0/5] drm/vc4: Fix negative X/Y positioning of planes Boris Brezillon
2018-07-25 15:32 ` [PATCH 1/5] drm/vc4: Fix TILE_Y_OFFSET definitions Boris Brezillon
2018-07-25 15:32 ` [PATCH 2/5] drm/vc4: Define missing PICTH0_SINK_PIX field Boris Brezillon
2018-07-27 20:24 ` Eric Anholt
2018-07-25 15:32 ` [PATCH 3/5] drm/vc4: Use drm_atomic_helper_check_plane_state() to simplify the logic Boris Brezillon
2018-07-27 20:38 ` Eric Anholt
2018-07-27 20:54 ` Boris Brezillon [this message]
2018-07-25 15:32 ` [PATCH 4/5] drm/vc4: Move ->offsets[] adjustment out of setup_clipping_and_scaling() Boris Brezillon
2018-07-27 20:55 ` Boris Brezillon
2018-07-25 15:32 ` [PATCH 5/5] drm/vc4: Fix negative X/Y positioning of planes using T_TILES modifier Boris Brezillon
2018-07-27 20:46 ` Eric Anholt
2018-07-27 20:59 ` Boris Brezillon
2018-08-03 9:06 ` Boris Brezillon
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=20180727225449.30f03175@bbrezillon \
--to=boris.brezillon@bootlin.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=eric@anholt.net \
/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.