All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: linux-omap@vger.kernel.org,
	Tomi Valkeinen <tomi.valkeinen@ti.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 06/21] drm/omap: check CRTC color format earlier
Date: Thu, 05 Mar 2015 01:53:18 +0200	[thread overview]
Message-ID: <4900803.cErxPF9b3H@avalon> (raw)
In-Reply-To: <20150227120757.GW24485@phenom.ffwll.local>

Hi Daniel,

On Friday 27 February 2015 13:07:57 Daniel Vetter wrote:
> On Thu, Feb 26, 2015 at 03:20:14PM +0200, Tomi Valkeinen wrote:
> > When setting a color format to a DRM plane, the DRM core checks whether
> > the format is supported by the HW. However, it seems that when setting
> > the color format of a CRTC (i.e. a root plane), there's no checking
> > done. This causes omapdrm to configure omapdss with the bad color
> > format, which omapdss then rejects.
> > 
> > While the above is ok, the error message is a bit confusing, and the
> > configuring of omapdss happens asynchronously from the ioctl that does
> > the color format change.
> > 
> > This patch adds a color format check to omap_plane_mode_set() which
> > causes the ioctl to return an error for invalid color format. This means
> > that the userspace will get to know of the wrong setting, instead of the
> > current behavior where the error is not seen by the userspace.
> > 
> > Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> > ---
> > 
> >  drivers/gpu/drm/omapdrm/omap_plane.c | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c
> > b/drivers/gpu/drm/omapdrm/omap_plane.c index 1f4f2b866379..bedd6f7af0f1
> > 100644
> > --- a/drivers/gpu/drm/omapdrm/omap_plane.c
> > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c
> > @@ -207,6 +207,24 @@ int omap_plane_mode_set(struct drm_plane *plane,
> > 
> >  {
> >  
> >  	struct omap_plane *omap_plane = to_omap_plane(plane);
> >  	struct omap_drm_window *win = &omap_plane->win;
> > 
> > +	int i;
> > +
> > +	/*
> > +	 * Check whether this plane supports the fb pixel format.
> > +	 * I don't think this should really be needed, but it looks like the
> > +	 * drm core only checks the format for planes, not for the crtc. So
> > +	 * when setting the format for crtc, without this check we would
> > +	 * get an error later when trying to program the color format into 
the
> > +	 * HW.
> > +	 */
> 
> I think we should add a format check to the setcrtc ioctl if crtc->primary
> is set. Atm the code is in __setplane_internal but could easily be shared
> - there's already a copy in drm_atomi.c.

I'll submit a patch.

> Omapdrm wouldn't benefit from this yet since it doesn't support universal
> planes. But adding universal planes should be on your todo anyway ;-)

Soon, soon :-)

> > +	for (i = 0; i < plane->format_count; i++)
> > +		if (fb->pixel_format == plane->format_types[i])
> > +			break;
> > +	if (i == plane->format_count) {
> > +		DBG("Invalid pixel format %s",
> > +			      drm_get_format_name(fb->pixel_format));
> > +		return -EINVAL;
> > +	}
> > 
> >  	win->crtc_x = crtc_x;
> >  	win->crtc_y = crtc_y;

-- 
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-03-04 23:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-26 13:20 [PATCH 00/21] drm/omap: misc fixes/improvements Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 01/21] drm/omap: fix encoder-crtc mapping Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 02/21] drm/omap: page_flip: return -EBUSY if flip pending Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 03/21] drm/omap: clear omap_obj->paddr in omap_gem_put_paddr() Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 04/21] drm/omap: add pin refcounting to omap_framebuffer Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 05/21] drm/omap: add a comment why locking is missing Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 06/21] drm/omap: check CRTC color format earlier Tomi Valkeinen
2015-02-27 12:07   ` Daniel Vetter
2015-03-02  9:55     ` Tomi Valkeinen
2015-03-04 23:41       ` Laurent Pinchart
2015-03-04 23:53     ` Laurent Pinchart [this message]
2015-02-26 13:20 ` [PATCH 07/21] drm/omap: fix operation without fbdev Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 08/21] drm/omap: fix error handling in omap_framebuffer_create() Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 09/21] drm/omap: handle mismatching color format and buffer width Tomi Valkeinen
2015-02-27 13:01   ` Daniel Vetter
2015-02-27 14:40     ` Daniel Stone
2015-02-27 15:47       ` Daniel Vetter
2015-03-02  9:50       ` Tomi Valkeinen
2015-03-02 10:22         ` Daniel Stone
2015-03-02 10:32           ` Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 10/21] drm/omap: fix TILER on OMAP5 Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 11/21] drm/omap: fix plane's channel selection Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 12/21] drm/omap: tiler: fix race condition with engine->async Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 13/21] drm/omap: remove dummy PM functions Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 14/21] drm/omap: stop connector polling during suspend Tomi Valkeinen
2015-02-26 13:57   ` Grygorii.Strashko@linaro.org
2015-03-02 11:03     ` Tomi Valkeinen
2015-03-02 18:35       ` Grygorii Strashko
2015-02-26 13:20 ` [PATCH 15/21] drm/omap: use DRM_ERROR_RATELIMITED() for error irqs Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 16/21] drm/omap: fix race with error_irq Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 17/21] drm/omap: only ignore DIGIT SYNC LOST for TV output Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 18/21] drm/omap: do not use BUG_ON(!spin_is_locked(x)) Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 19/21] drm/omap: fix race condition with dev->obj_list Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 20/21] drm/omap: fix race conditon in DMM Tomi Valkeinen
2015-02-26 13:20 ` [PATCH 21/21] drm/omap: keep ref to old_fb Tomi Valkeinen

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=4900803.cErxPF9b3H@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.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 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.