devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
To: Daniel Vetter <daniel-/w4YWyX8dFk@public.gmane.org>
Cc: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Paul Bolle <pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org>,
	YT Shen <yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Jitao Shi <jitao.shi-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	Ian Campbell
	<ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org>,
	Cawa Cheng <cawa.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
	kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org,
	Kumar Gala <galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org>,
	Matthias Brugger
	<matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [RFC v2 2/4] drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.
Date: Tue, 22 Sep 2015 12:06:22 +0200	[thread overview]
Message-ID: <1442916382.3128.18.camel@pengutronix.de> (raw)
In-Reply-To: <20150922093842.GE3383-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>

Hi Daniel,

thank you for the comments.

Am Dienstag, den 22.09.2015, 11:38 +0200 schrieb Daniel Vetter:
[...]
> > diff --git a/drivers/gpu/drm/mediatek/mtk_drm_drv.c b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > new file mode 100644
> > index 0000000..fc071fe
> > --- /dev/null
> > +++ b/drivers/gpu/drm/mediatek/mtk_drm_drv.c
> > @@ -0,0 +1,471 @@
[...]
> > +static int mtk_atomic_commit(struct drm_device *dev,
> > +			     struct drm_atomic_state *state,
> > +			     bool async)
> > +{
> > +	return drm_atomic_helper_commit(dev, state, false);
> 
> This isn't a proper async commit operation, it will still block userspace
> unecessarily. See e.g. the vc4 patches for a proper one.

I'll drop this function and assign .atomic_commit to
drm_atomic_helper_commit directly.

[...]
> > +static int mtk_plane_atomic_check(struct drm_plane *plane,
> > +		struct drm_plane_state *state)
> > +{
[...]
> > +	ret = drm_plane_helper_check_update(plane, state->crtc, fb,
> > +					    &src, &dest, &clip,
> > +					    DRM_PLANE_HELPER_NO_SCALING,
> > +					    DRM_PLANE_HELPER_NO_SCALING,
> > +					    true, true, &visible);
> > +	if (ret)
> > +		return ret;
> > +
> > +	if (!visible)
> > +		return 0;
> > +
> > +	mtk_plane->disp_size = (dest.y2 - dest.y1) << 16 | (dest.x2 - dest.x1);
> 
> I think it might work out ok but it's very fragile to update object state
> from your atomic_check hooks - atomic allows a TEST_ONLY mode and if
> that's used (generic userspace will do that a few times for each frame at
> least) then you clobber shared state. Instead it's better to store that in
> your own mtk_plane_state which subclasses drm_plane_state.

Ok, will do.

[...]
> > +static void mtk_plane_attach_zpos_property(struct drm_plane *plane,
> > +		unsigned int zpos, unsigned int max_plane)
> > +{
> > +	struct drm_device *dev = plane->dev;
> > +	struct mtk_drm_private *dev_priv = dev->dev_private;
> > +	struct drm_property *prop;
> > +
> > +	prop = dev_priv->plane_zpos_property;
> > +	if (!prop) {
> > +		prop = drm_property_create_range(dev, DRM_MODE_PROP_IMMUTABLE,
> > +						 "zpos", 0, max_plane - 1);
> 
> I know that there's lots of other drivers exposing zpos already, but I
> really think we should standardize this properly and document what it
> means. So
> - add a bit more text to the kerneldoc/doobook, especially what should
>   happen when there's a conflict in zpos.
> - move zpos registration/decoding into drm core, which means adding it to
>   drm_plane_state
> - have an open-source implementation using this somewhere (ddx, wayland,
>   hwc, ...).
> 
> I think for now it's better to drop the zpos property from initial
> mediatek enabling.

Alright, I'll separate this from the initial patchset.

best regards
Philipp

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2015-09-22 10:06 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-18 16:11 [RFC v2 0/4] MT8173 DRM support Philipp Zabel
2015-09-18 16:11 ` [RFC v2 1/4] dt-bindings: drm/mediatek: Add Mediatek display subsystem dts binding Philipp Zabel
     [not found]   ` <1442592722-29004-2-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-09-18 20:33     ` Rob Herring
2015-09-21  8:11       ` Philipp Zabel
     [not found]         ` <1442823067.3277.35.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-09-30 17:13           ` Rob Herring
2015-10-01  8:59             ` Philipp Zabel
2015-10-01 12:58               ` Rob Herring
2015-10-01 14:29                 ` Daniel Kurtz
     [not found]                   ` <CAGS+omAs4Jvu7tKEMoNL9BSMQMwW=9UHzXW8_jS=5MbajaJzOg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-02  7:40                     ` Philipp Zabel
2015-10-02 13:47                       ` Daniel Kurtz
     [not found]                         ` <CAGS+omC3M71q8XMRevnM-_aocZXryK7NFDnVnJCdiG6tM-PjUQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-02 14:33                           ` Philipp Zabel
2015-10-23 12:29                   ` Rob Herring
     [not found]                 ` <CAL_Jsq+aBxjvPyAR3nUtXny6JwgcopSCENrBaGzo7OKXFA1cvg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-02  7:18                   ` Philipp Zabel
2015-10-02 14:24                     ` Rob Herring
     [not found]                       ` <CAL_JsqJhoysg=39gsArwmxf3xpzeXeHhxJ7THq4SbVc-NyertQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-10-02 14:51                         ` Philipp Zabel
2015-09-30 15:30       ` Philipp Zabel
2015-09-30 16:57         ` Rob Herring
2015-10-01  8:59           ` Philipp Zabel
2015-09-18 16:12 ` [RFC v2 2/4] drm/mediatek: Add DRM Driver for Mediatek SoC MT8173 Philipp Zabel
     [not found]   ` <1442592722-29004-3-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2015-09-22  9:38     ` Daniel Vetter
     [not found]       ` <20150922093842.GE3383-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2015-09-22 10:06         ` Philipp Zabel [this message]
2015-09-18 16:12 ` [RFC v2 3/4] drm/mediatek: Add DSI sub driver Philipp Zabel
2015-09-18 16:12 ` [RFC v2 4/4] drm/mediatek: Add DRM-based framebuffer device Philipp Zabel
2015-09-22  9:29   ` Daniel Vetter
     [not found]     ` <20150922092951.GD3383-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2015-09-22 10:35       ` Philipp Zabel

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=1442916382.3128.18.camel@pengutronix.de \
    --to=p.zabel-bicnvbalz9megne8c9+irq@public.gmane.org \
    --cc=cawa.cheng-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=daniel-/w4YWyX8dFk@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org \
    --cc=ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org \
    --cc=jitao.shi-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org \
    --cc=kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=linux-mediatek-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=matthias.bgg-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=pebolle-IWqWACnzNjzz+pZb47iToQ@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=yt.shen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.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 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).