Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1397108

Re: [PATCH 3/4] drm: Add helper for simple display pipeline

From Daniel Vetter <daniel@ffwll.ch>
Newsgroups linux.kernel
Subject Re: [PATCH 3/4] drm: Add helper for simple display pipeline
Date 2016-05-09 16:50 +0200
Message-ID <rwUFr-7AA-3@gated-at.bofh.it> (permalink)
References <rvrvQ-MH-21@gated-at.bofh.it> <rvrvR-MH-39@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, May 05, 2016 at 03:24:33PM +0200, Noralf Trønnes wrote:
> Provides helper functions for drivers that have a simple display
> pipeline. Plane, crtc and encoder are collapsed into one entity.
> 
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>

> +static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,
> +					struct drm_plane_state *pstate)
> +{
> +	struct drm_simple_display_pipe *pipe;
> +	struct drm_crtc_state *cstate;
> +
> +	pipe = container_of(plane, struct drm_simple_display_pipe, plane);
> +	if (!pipe->funcs || !pipe->funcs->check)
> +		return 0;
> +
> +	cstate = drm_atomic_get_existing_crtc_state(pstate->state,
> +						    &pipe->crtc);
> +
> +	return pipe->funcs->check(pipe, pstate, cstate);
> +}

Ok one thing I've missed here is that for most drivers this is way too
simple a check function, which means we'll end up with tons of duplicated
code. Things which the drm core allows, but simple pipelines all don't
really cope with:
- plane scaling
- disabling the plane without the crtc (i.e. scan out black)
- plane not sized to fill the entire hactive/vactive

There's a helper to do most of these checks for you -
drm_plane_helper_check_update. I think it'd be good to place a call for
that in here, before we call down into the driver's ->check callback. But
ofc before we return 0; we want these checks always done. And catch all
these things so that drivers never fall over this pitfall.

Noticed while discussing tilcdc atomic patches, since tilcdc could
probably use drm_simple_display_pipe too.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] drm: Add various helpers for simple drivers Noralf Trønnes <noralf@tronnes.org> - 2016-05-05 15:30 +0200
  [PATCH 2/4] drm: Make drm_encoder_helper_funcs optional Noralf Trønnes <noralf@tronnes.org> - 2016-05-05 15:30 +0200
    Re: [PATCH 2/4] drm: Make drm_encoder_helper_funcs optional Daniel Vetter <daniel@ffwll.ch> - 2016-05-05 18:30 +0200
      Re: [PATCH 2/4] drm: Make drm_encoder_helper_funcs optional Noralf Trønnes <noralf@tronnes.org> - 2016-05-09 21:20 +0200
        Re: [PATCH 2/4] drm: Make drm_encoder_helper_funcs optional Daniel Vetter <daniel@ffwll.ch> - 2016-05-10 09:00 +0200
  [PATCH 3/4] drm: Add helper for simple display pipeline Noralf Trønnes <noralf@tronnes.org> - 2016-05-05 15:30 +0200
    Re: [PATCH 3/4] drm: Add helper for simple display pipeline Daniel Vetter <daniel@ffwll.ch> - 2016-05-05 18:50 +0200
    Re: [PATCH 3/4] drm: Add helper for simple display pipeline Daniel Vetter <daniel@ffwll.ch> - 2016-05-09 16:50 +0200
      Re: [PATCH 3/4] drm: Add helper for simple display pipeline Noralf Trønnes <noralf@tronnes.org> - 2016-05-09 20:40 +0200
        Re: [PATCH 3/4] drm: Add helper for simple display pipeline Daniel Vetter <daniel@ffwll.ch> - 2016-05-10 09:00 +0200
          Re: [PATCH 3/4] drm: Add helper for simple display pipeline Daniel Vetter <daniel@ffwll.ch> - 2016-05-11 00:40 +0200
  [PATCH 1/4] drm/fb-cma-helper: Add function drm_fb_cma_create_with_funcs() Noralf Trønnes <noralf@tronnes.org> - 2016-05-05 15:30 +0200
    Re: [PATCH 1/4] drm/fb-cma-helper: Add function  drm_fb_cma_create_with_funcs() Daniel Vetter <daniel@ffwll.ch> - 2016-05-05 18:30 +0200
      Re: [PATCH 1/4] drm/fb-cma-helper: Add function  drm_fb_cma_create_with_funcs() Noralf Trønnes <noralf@tronnes.org> - 2016-05-06 15:10 +0200
        Re: [PATCH 1/4] drm/fb-cma-helper: Add function  drm_fb_cma_create_with_funcs() Daniel Vetter <daniel@ffwll.ch> - 2016-05-06 15:20 +0200

csiph-web