dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: ville.syrjala@linux.intel.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 32/32] drm: Nuke fb->pixel_format
Date: Thu, 17 Nov 2016 20:39:04 +0200	[thread overview]
Message-ID: <10276742.VRT1PEbuap@avalon> (raw)
In-Reply-To: <1479399271-31991-33-git-send-email-ville.syrjala@linux.intel.com>

Hi Ville,

Thank you for the patch.

On Thursday 17 Nov 2016 18:14:31 ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Replace uses of fb->bits_per_pixel with fb->format->format.

I assume you mean fb->pixel_format.

> Less duplicated information is a good thing.
> 
> Note that coccinelle failed to eliminate the
> "/* fourcc format */" comment from drm_framebuffer.h, so I had
> to do that part manually.

[snip]

> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/dce_v10_0.c          |  4 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v11_0.c          |  4 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v6_0.c           |  4 +--
>  drivers/gpu/drm/amd/amdgpu/dce_v8_0.c           |  4 +--
>  drivers/gpu/drm/arc/arcpgu_crtc.c               |  2 +-
>  drivers/gpu/drm/arm/hdlcd_crtc.c                |  4 +--
>  drivers/gpu/drm/arm/malidp_planes.c             | 10 +++----
>  drivers/gpu/drm/armada/armada_crtc.c            |  2 +-
>  drivers/gpu/drm/armada/armada_overlay.c         |  2 +-
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_layer.c |  2 +-
>  drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++-------
>  drivers/gpu/drm/drm_atomic.c                    |  6 ++--
>  drivers/gpu/drm/drm_crtc.c                      |  4 +--
>  drivers/gpu/drm/drm_crtc_helper.c               |  4 +--
>  drivers/gpu/drm/drm_fb_cma_helper.c             |  2 +-
>  drivers/gpu/drm/drm_framebuffer.c               |  2 +-
>  drivers/gpu/drm/drm_modeset_helper.c            |  1 -
>  drivers/gpu/drm/drm_plane.c                     |  6 ++--
>  drivers/gpu/drm/exynos/exynos5433_drm_decon.c   |  2 +-
>  drivers/gpu/drm/exynos/exynos7_drm_decon.c      |  2 +-
>  drivers/gpu/drm/exynos/exynos_drm_fimd.c        |  2 +-
>  drivers/gpu/drm/exynos/exynos_mixer.c           |  8 ++---
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c     |  4 +--
>  drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c |  6 ++--
>  drivers/gpu/drm/i915/i915_debugfs.c             |  3 +-
>  drivers/gpu/drm/i915/intel_atomic_plane.c       |  4 +--
>  drivers/gpu/drm/i915/intel_display.c            | 33 ++++++++++----------
>  drivers/gpu/drm/i915/intel_fbdev.c              |  2 +-
>  drivers/gpu/drm/i915/intel_overlay.c            |  2 +-
>  drivers/gpu/drm/i915/intel_pm.c                 | 10 +++----
>  drivers/gpu/drm/i915/intel_sprite.c             | 12 ++++----
>  drivers/gpu/drm/imx/ipuv3-plane.c               | 40 +++++++++-------------
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c        |  2 +-
>  drivers/gpu/drm/msm/mdp/mdp4/mdp4_plane.c       |  2 +-
>  drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c       |  4 +--
>  drivers/gpu/drm/msm/msm_fb.c                    | 10 +++----
>  drivers/gpu/drm/nouveau/dispnv04/overlay.c      |  8 ++---
>  drivers/gpu/drm/nouveau/nv50_display.c          |  4 +--
>  drivers/gpu/drm/omapdrm/omap_fb.c               | 10 +++----
>  drivers/gpu/drm/radeon/atombios_crtc.c          |  8 ++---
>  drivers/gpu/drm/rcar-du/rcar_du_plane.c         |  4 +--
>  drivers/gpu/drm/rcar-du/rcar_du_vsp.c           |  4 +--
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c     | 22 +++++++-------
>  drivers/gpu/drm/shmobile/shmob_drm_crtc.c       |  6 ++--
>  drivers/gpu/drm/shmobile/shmob_drm_plane.c      |  4 +--
>  drivers/gpu/drm/sti/sti_gdp.c                   | 10 +++----
>  drivers/gpu/drm/sti/sti_hqvdp.c                 |  2 +-
>  drivers/gpu/drm/sun4i/sun4i_backend.c           |  5 ++--
>  drivers/gpu/drm/tegra/dc.c                      |  6 ++--
>  drivers/gpu/drm/tegra/fb.c                      |  2 +-
>  drivers/gpu/drm/tilcdc/tilcdc_crtc.c            |  4 +--
>  drivers/gpu/drm/tilcdc/tilcdc_plane.c           |  4 +--
>  drivers/gpu/drm/vc4/vc4_plane.c                 |  6 ++--
>  drivers/gpu/drm/vmwgfx/vmwgfx_kms.c             |  2 --
>  drivers/gpu/drm/zte/zx_plane.c                  |  2 +-
>  include/drm/drm_framebuffer.h                   |  4 ---
>  56 files changed, 171 insertions(+), 179 deletions(-)

[snip]

> diff --git a/drivers/gpu/drm/drm_crtc_helper.c
> b/drivers/gpu/drm/drm_crtc_helper.c index 5d2cb138eba6..94bce0b462aa 100644
> --- a/drivers/gpu/drm/drm_crtc_helper.c
> +++ b/drivers/gpu/drm/drm_crtc_helper.c
> @@ -588,8 +588,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
> if (set->crtc->primary->fb == NULL) {
>  			DRM_DEBUG_KMS("crtc has no fb, full mode set\n");
>  			mode_changed = true;
> -		} else if (set->fb->pixel_format !=
> -			   set->crtc->primary->fb->pixel_format) {
> +		} else if (set->fb->format->format !=
> +			   set->crtc->primary->fb->format->format) {
>  			mode_changed = true;

You could also compare set->fb->format != set->crtc->primary->fb->format which 
should be slightly more efficient.

>  		} else
>  			fb_changed = true;

[snip]

> diff --git a/drivers/gpu/drm/drm_framebuffer.c
> b/drivers/gpu/drm/drm_framebuffer.c index 98c054098808..e48c9e7fa78e 100644
> --- a/drivers/gpu/drm/drm_framebuffer.c
> +++ b/drivers/gpu/drm/drm_framebuffer.c
> @@ -634,7 +634,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct
> drm_framebuffer *fb, INIT_LIST_HEAD(&fb->filp_head);
>  	if (WARN_ON_ONCE(fb->dev != dev)) {
>  		fb->dev = dev;
> -		fb->format = drm_format_info(fb->pixel_format);
> +		fb->format = drm_format_info(fb->format->format);

This is an interesting one :-) If fb->format is NULL you will crash, and if it 
isn't this is a no-op.

>  	}
>  	fb->funcs = funcs;

[snip]

> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c
> b/drivers/gpu/drm/i915/i915_debugfs.c index ee272ec8732c..e571e9a37ac4
> 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -3042,7 +3042,8 @@ static void intel_plane_info(struct seq_file *m,
> struct intel_crtc *intel_crtc) state = plane->state;
> 
>  		if (state->fb) {
> -			drm_get_format_name(state->fb->pixel_format, 
&format_name);
> +			drm_get_format_name(state->fb->format->format,
> +					    &format_name);

(randomly picking a driver for this comment)

As a candidate for another patch series, what would you think about storing 
format names in the format info structure, and getting rid of the 
drm_get_format_name() function ? It might increase the kernel size a bit 
though, but I don't think that's an issue.

>  		} else {
>  			sprintf(format_name.str, "N/A");
>  		}

[snip]

> diff --git a/drivers/gpu/drm/i915/intel_display.c
> b/drivers/gpu/drm/i915/intel_display.c index 6c889f0e8e0f..f5f9f1422d69
> 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c

[snip]

> @@ -12151,7 +12148,7 @@ static int intel_crtc_page_flip(struct drm_crtc
> *crtc, return -EBUSY;
> 
>  	/* Can't change pixel format via MI display flips. */
> -	if (fb->pixel_format != crtc->primary->fb->pixel_format)
> +	if (fb->format->format != crtc->primary->fb->format->format)

You can write this

	fb->format != crtc->primary->fb->format

>  		return -EINVAL;

[snip]

> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c
> b/drivers/gpu/drm/imx/ipuv3-plane.c index e74a0ad52950..76fcc5f0d9e1 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -77,7 +77,7 @@ drm_plane_state_to_eba(struct drm_plane_state *state)
>  	BUG_ON(!cma_obj);
> 
>  	return cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y +
> -	       drm_format_plane_cpp(fb->pixel_format, 0) * x;
> +	       drm_format_plane_cpp(fb->format->format, 0) * x;

You should use fb->format->cpp[0]. Likewise for the other format information 
fields accessed in this driver.

>  }
> 
>  static inline unsigned long
> @@ -92,11 +92,11 @@ drm_plane_state_to_ubo(struct drm_plane_state *state)
>  	cma_obj = drm_fb_cma_get_gem_obj(fb, 1);
>  	BUG_ON(!cma_obj);
> 
> -	x /= drm_format_horz_chroma_subsampling(fb->pixel_format);
> -	y /= drm_format_vert_chroma_subsampling(fb->pixel_format);
> +	x /= drm_format_horz_chroma_subsampling(fb->format->format);
> +	y /= drm_format_vert_chroma_subsampling(fb->format->format);
> 
>  	return cma_obj->paddr + fb->offsets[1] + fb->pitches[1] * y +
> -	       drm_format_plane_cpp(fb->pixel_format, 1) * x - eba;
> +	       drm_format_plane_cpp(fb->format->format, 1) * x - eba;
>  }
> 
>  static inline unsigned long
> @@ -111,11 +111,11 @@ drm_plane_state_to_vbo(struct drm_plane_state *state)
>  	cma_obj = drm_fb_cma_get_gem_obj(fb, 2);
>  	BUG_ON(!cma_obj);
> 
> -	x /= drm_format_horz_chroma_subsampling(fb->pixel_format);
> -	y /= drm_format_vert_chroma_subsampling(fb->pixel_format);
> +	x /= drm_format_horz_chroma_subsampling(fb->format->format);
> +	y /= drm_format_vert_chroma_subsampling(fb->format->format);
> 
>  	return cma_obj->paddr + fb->offsets[2] + fb->pitches[2] * y +
> -	       drm_format_plane_cpp(fb->pixel_format, 2) * x - eba;
> +	       drm_format_plane_cpp(fb->format->format, 2) * x - eba;
>  }
> 
>  void ipu_plane_put_resources(struct ipu_plane *ipu_plane)
> @@ -281,7 +281,7 @@ static int ipu_plane_atomic_check(struct drm_plane
> *plane, */
>  	if (old_fb && (state->src_w != old_state->src_w ||
>  			      state->src_h != old_state->src_h ||
> -			      fb->pixel_format != old_fb->pixel_format))
> +			      fb->format->format != old_fb->format->format))

	fb->format != old_fb->format

Likewise for the other locations in this driver.

[snip]


> diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c index
> 81c0562ab489..fb32d4563d92 100644
> --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c
> @@ -340,7 +340,7 @@ static int mdp5_plane_atomic_check(struct drm_plane
> *plane, if (plane_enabled(state) && plane_enabled(old_state)) {
>  		/* we cannot change SMP block configuration during scanout: */
>  		bool full_modeset = false;
> -		if (state->fb->pixel_format != old_state->fb->pixel_format) {
> +		if (state->fb->format->format != old_state->fb->format-
>format) {

Ditto.

>  			DBG("%s: pixel_format change!", mdp5_plane->name);
>  			full_modeset = true;
>  		}
> @@ -703,7 +703,7 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,
>  	unsigned long flags;
>  	int ret;
> 
> -	nplanes = drm_format_num_planes(fb->pixel_format);
> +	nplanes = drm_format_num_planes(fb->format->format);

	fb->format->num_planes

> 
>  	/* bad formats should already be rejected: */
>  	if (WARN_ON(nplanes > pipe2nclients(pipe)))
> diff --git a/drivers/gpu/drm/msm/msm_fb.c b/drivers/gpu/drm/msm/msm_fb.c
> index 9614ed405808..5b579248fbaa 100644
> --- a/drivers/gpu/drm/msm/msm_fb.c
> +++ b/drivers/gpu/drm/msm/msm_fb.c
> @@ -41,7 +41,7 @@ static int msm_framebuffer_create_handle(struct
> drm_framebuffer *fb, static void msm_framebuffer_destroy(struct
> drm_framebuffer *fb)
>  {
>  	struct msm_framebuffer *msm_fb = to_msm_framebuffer(fb);
> -	int i, n = drm_format_num_planes(fb->pixel_format);
> +	int i, n = drm_format_num_planes(fb->format->format);

Same here and below.

>  	DBG("destroy: FB ID: %d (%p)", fb->base.id, fb);
> 
> @@ -65,10 +65,10 @@ static const struct drm_framebuffer_funcs
> msm_framebuffer_funcs = { void msm_framebuffer_describe(struct
> drm_framebuffer *fb, struct seq_file *m) {
>  	struct msm_framebuffer *msm_fb = to_msm_framebuffer(fb);
> -	int i, n = drm_format_num_planes(fb->pixel_format);
> +	int i, n = drm_format_num_planes(fb->format->format);
> 
>  	seq_printf(m, "fb: %dx%d@%4.4s (%2d, ID:%d)\n",
> -			fb->width, fb->height, (char *)&fb->pixel_format,
> +			fb->width, fb->height, (char *)&fb->format->format,
>  			drm_framebuffer_read_refcount(fb), fb->base.id);
> 
>  	for (i = 0; i < n; i++) {
> @@ -87,7 +87,7 @@ void msm_framebuffer_describe(struct drm_framebuffer *fb,
> struct seq_file *m) int msm_framebuffer_prepare(struct drm_framebuffer *fb,
> int id)
>  {
>  	struct msm_framebuffer *msm_fb = to_msm_framebuffer(fb);
> -	int ret, i, n = drm_format_num_planes(fb->pixel_format);
> +	int ret, i, n = drm_format_num_planes(fb->format->format);
>  	uint32_t iova;
> 
>  	for (i = 0; i < n; i++) {
> @@ -103,7 +103,7 @@ int msm_framebuffer_prepare(struct drm_framebuffer *fb,
> int id) void msm_framebuffer_cleanup(struct drm_framebuffer *fb, int id)
>  {
>  	struct msm_framebuffer *msm_fb = to_msm_framebuffer(fb);
> -	int i, n = drm_format_num_planes(fb->pixel_format);
> +	int i, n = drm_format_num_planes(fb->format->format);
> 
>  	for (i = 0; i < n; i++)
>  		msm_gem_put_iova(msm_fb->planes[i], id);

[snip]

> diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c
> b/drivers/gpu/drm/omapdrm/omap_fb.c index 9875c99be009..d2742772b9d8 100644
> --- a/drivers/gpu/drm/omapdrm/omap_fb.c
> +++ b/drivers/gpu/drm/omapdrm/omap_fb.c
> @@ -107,7 +107,7 @@ static int omap_framebuffer_create_handle(struct
> drm_framebuffer *fb, static void omap_framebuffer_destroy(struct
> drm_framebuffer *fb)
>  {
>  	struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
> -	int i, n = drm_format_num_planes(fb->pixel_format);
> +	int i, n = drm_format_num_planes(fb->format->format);

	fb->format->num_planes

Same comment for the other locations below.

>  	DBG("destroy: FB ID: %d (%p)", fb->base.id, fb);
> 
> @@ -252,7 +252,7 @@ void omap_framebuffer_update_scanout(struct
> drm_framebuffer *fb, int omap_framebuffer_pin(struct drm_framebuffer *fb)
>  {
>  	struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
> -	int ret, i, n = drm_format_num_planes(fb->pixel_format);
> +	int ret, i, n = drm_format_num_planes(fb->format->format);
> 
>  	mutex_lock(&omap_fb->lock);
> 
> @@ -292,7 +292,7 @@ int omap_framebuffer_pin(struct drm_framebuffer *fb)
>  void omap_framebuffer_unpin(struct drm_framebuffer *fb)
>  {
>  	struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
> -	int i, n = drm_format_num_planes(fb->pixel_format);
> +	int i, n = drm_format_num_planes(fb->format->format);
> 
>  	mutex_lock(&omap_fb->lock);
> 
> @@ -343,10 +343,10 @@ struct drm_connector
> *omap_framebuffer_get_next_connector( void omap_framebuffer_describe(struct
> drm_framebuffer *fb, struct seq_file *m) {
>  	struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb);
> -	int i, n = drm_format_num_planes(fb->pixel_format);
> +	int i, n = drm_format_num_planes(fb->format->format);
> 
>  	seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height,
> -			(char *)&fb->pixel_format);
> +			(char *)&fb->format->format);
> 
>  	for (i = 0; i < n; i++) {
>  		struct plane *plane = &omap_fb->planes[i];

[snip]

> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index
> c7eba305c488..f8c6f74edc80 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c

[snip]

> @@ -749,21 +749,21 @@ static void vop_plane_atomic_update(struct drm_plane
> *plane, dsp_sty = dest->y1 + crtc->mode.vtotal - crtc->mode.vsync_start;
> dsp_st = dsp_sty << 16 | (dsp_stx & 0xffff);
> 
> -	offset = (src->x1 >> 16) * drm_format_plane_cpp(fb->pixel_format, 0);
> +	offset = (src->x1 >> 16) * drm_format_plane_cpp(fb->format->format, 
0);

fb->format->cpp[0]

Same comment for the other fields accessed below.

>  	offset += (src->y1 >> 16) * fb->pitches[0];
>  	dma_addr = rk_obj->dma_addr + offset + fb->offsets[0];
> 
> -	format = vop_convert_format(fb->pixel_format);
> +	format = vop_convert_format(fb->format->format);
> 
>  	spin_lock(&vop->reg_lock);
> 
>  	VOP_WIN_SET(vop, win, format, format);
>  	VOP_WIN_SET(vop, win, yrgb_vir, fb->pitches[0] >> 2);
>  	VOP_WIN_SET(vop, win, yrgb_mst, dma_addr);
> -	if (is_yuv_support(fb->pixel_format)) {
> -		int hsub = drm_format_horz_chroma_subsampling(fb-
>pixel_format);
> -		int vsub = drm_format_vert_chroma_subsampling(fb-
>pixel_format);
> -		int bpp = drm_format_plane_cpp(fb->pixel_format, 1);
> +	if (is_yuv_support(fb->format->format)) {
> +		int hsub = drm_format_horz_chroma_subsampling(fb->format-
>format);
> +		int vsub = drm_format_vert_chroma_subsampling(fb->format-
>format);
> +		int bpp = drm_format_plane_cpp(fb->format->format, 1);
> 
>  		uv_obj = rockchip_fb_get_gem_obj(fb, 1);
>  		rk_uv_obj = to_rockchip_obj(uv_obj);

[snip]

> diff --git a/drivers/gpu/drm/sti/sti_gdp.c b/drivers/gpu/drm/sti/sti_gdp.c
> index 81df3097b545..33821dda79df 100644
> --- a/drivers/gpu/drm/sti/sti_gdp.c
> +++ b/drivers/gpu/drm/sti/sti_gdp.c

[snip]

> @@ -753,11 +753,11 @@ static void sti_gdp_atomic_update(struct drm_plane
> *drm_plane, cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
> 
>  	DRM_DEBUG_DRIVER("drm FB:%d format:%.4s phys@:0x%lx\n", fb->base.id,
> -			 (char *)&fb->pixel_format,
> +			 (char *)&fb->format->format,
>  			 (unsigned long)cma_obj->paddr);
> 
>  	/* pixel memory location */
> -	bpp = drm_format_plane_cpp(fb->pixel_format, 0);
> +	bpp = drm_format_plane_cpp(fb->format->format, 0);

fb->format->cpp[0]

>  	top_field->gam_gdp_pml = (u32)cma_obj->paddr + fb->offsets[0];
>  	top_field->gam_gdp_pml += src_x * bpp;
>  	top_field->gam_gdp_pml += src_y * fb->pitches[0];


> diff --git a/drivers/gpu/drm/sun4i/sun4i_backend.c
> b/drivers/gpu/drm/sun4i/sun4i_backend.c index 2e08f969bb64..8719acf745c2
> 100644
> --- a/drivers/gpu/drm/sun4i/sun4i_backend.c
> +++ b/drivers/gpu/drm/sun4i/sun4i_backend.c

[snip]

> @@ -218,7 +219,7 @@ int sun4i_backend_update_layer_buffer(struct
> sun4i_backend *backend, DRM_DEBUG_DRIVER("Using GEM @ %pad\n",
> &gem->paddr);
> 
>  	/* Compute the start of the displayed memory */
> -	bpp = drm_format_plane_cpp(fb->pixel_format, 0);
> +	bpp = drm_format_plane_cpp(fb->format->format, 0);

Ditto.

>  	paddr = gem->paddr + fb->offsets[0];
>  	paddr += (state->src_x >> 16) * bpp;
>  	paddr += (state->src_y >> 16) * fb->pitches[0];
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index 3af157a2d40c..4121d0c2aac8 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c

[snip]

> @@ -531,7 +531,7 @@ static int tegra_plane_atomic_check(struct drm_plane
> *plane, * error out if the user tries to display a framebuffer with such a
> * configuration.
>  	 */
> -	if (drm_format_num_planes(state->fb->pixel_format) > 2) {
> +	if (drm_format_num_planes(state->fb->format->format) > 2) {

state->fb->format->num_planes

>  		if (state->fb->pitches[2] != state->fb->pitches[1]) {
>  			DRM_ERROR("unsupported UV-plane configuration\n");
>  			return -EINVAL;
> @@ -576,7 +576,7 @@ static void tegra_plane_atomic_update(struct drm_plane
> *plane, window.format = state->format;
>  	window.swap = state->swap;
> 
> -	for (i = 0; i < drm_format_num_planes(fb->pixel_format); i++) {
> +	for (i = 0; i < drm_format_num_planes(fb->format->format); i++) {

Same here.

>  		struct tegra_bo *bo = tegra_fb_get_plane(fb, i);
> 
>  		window.base[i] = bo->paddr + fb->offsets[i];
> diff --git a/drivers/gpu/drm/tegra/fb.c b/drivers/gpu/drm/tegra/fb.c
> index 2a1bf92403b8..1ea5c39a4411 100644
> --- a/drivers/gpu/drm/tegra/fb.c
> +++ b/drivers/gpu/drm/tegra/fb.c
> @@ -32,7 +32,7 @@ struct tegra_bo *tegra_fb_get_plane(struct drm_framebuffer
> *framebuffer, {
>  	struct tegra_fb *fb = to_tegra_fb(framebuffer);
> 
> -	if (index >= drm_format_num_planes(framebuffer->pixel_format))
> +	if (index >= drm_format_num_planes(framebuffer->format->format))

And here.

>  		return NULL;
> 
>  	return fb->planes[index];
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c index 822531ebd4b0..d00c59e115ff
> 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -79,7 +79,7 @@ static void set_scanout(struct drm_crtc *crtc, struct
> drm_framebuffer *fb)
> 
>  	start = gem->paddr + fb->offsets[0] +
>  		crtc->y * fb->pitches[0] +
> -		crtc->x * drm_format_plane_cpp(fb->pixel_format, 0);
> +		crtc->x * drm_format_plane_cpp(fb->format->format, 0);

I think you know what to do by now :-)

> 
>  	end = start + (crtc->mode.vdisplay * fb->pitches[0]);

[snip]

> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
> b/drivers/gpu/drm/tilcdc/tilcdc_plane.c index 8a6a50d74aff..5a303a81ac96
> 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_plane.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_plane.c
> @@ -69,7 +69,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane
> *plane, }
> 
>  	pitch = crtc_state->mode.hdisplay *
> -		drm_format_plane_cpp(state->fb->pixel_format, 0);
> +		drm_format_plane_cpp(state->fb->format->format, 0);

Ditto.

>  	if (state->fb->pitches[0] != pitch) {
>  		dev_err(plane->dev->dev,
>  			"Invalid pitch: fb and crtc widths must be the same");
> @@ -77,7 +77,7 @@ static int tilcdc_plane_atomic_check(struct drm_plane
> *plane, }
> 
>  	if (state->fb && old_state->fb &&
> -	    state->fb->pixel_format != old_state->fb->pixel_format) {
> +	    state->fb->format->format != old_state->fb->format->format) {

state->fb->format != old_state->fb->format

>  		dev_dbg(plane->dev->dev,
>  			"%s(): pixel format change requires mode_change\n",
>  			__func__);
> diff --git a/drivers/gpu/drm/vc4/vc4_plane.c
> b/drivers/gpu/drm/vc4/vc4_plane.c index 881bf489478b..59be9e7c26de 100644
> --- a/drivers/gpu/drm/vc4/vc4_plane.c
> +++ b/drivers/gpu/drm/vc4/vc4_plane.c

[snip]

> @@ -369,7 +369,7 @@ static int vc4_plane_setup_clipping_and_scaling(struct
> drm_plane_state *state) */
>  	if (vc4_state->crtc_x < 0) {
>  		for (i = 0; i < num_planes; i++) {
> -			u32 cpp = drm_format_plane_cpp(fb->pixel_format, i);
> +			u32 cpp = drm_format_plane_cpp(fb->format->format, i);

fb->format->cpp[i]

>  			u32 subs = ((i == 0) ? 1 : h_subsample);
> 
>  			vc4_state->offsets[i] += (cpp *

[snip]

-- 
Regards,

Laurent Pinchart

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

      parent reply	other threads:[~2016-11-17 18:38 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-17 16:13 [PATCH 00/32] drm: Deduplicate fb format information ville.syrjala
2016-11-17 16:14 ` [PATCH 01/32] drm/i915: Add local 'fb' variables ville.syrjala
2016-11-17 16:14 ` [PATCH 02/32] drm/radeon: " ville.syrjala
2016-11-17 17:21   ` Alex Deucher
2016-11-17 16:14 ` [PATCH 03/32] drm/radeon: Use DIV_ROUND_UP() ville.syrjala
2016-11-17 17:22   ` Alex Deucher
2016-11-17 16:14 ` [PATCH 04/32] drm/mgag200: Add local 'fb' variable ville.syrjala
2016-11-17 16:14 ` [PATCH 05/32] drm/ast: Add local 'fb' variables ville.syrjala
2016-11-17 16:14 ` [PATCH 06/32] drm/gma500: Add some " ville.syrjala
2016-11-17 16:14 ` [PATCH 07/32] drm/cirrus: " ville.syrjala
2016-11-17 16:14 ` [PATCH 08/32] drm/arcpgu: Add " ville.syrjala
2016-11-17 16:14 ` [PATCH 09/32] drm/arm: " ville.syrjala
2016-11-17 16:14 ` [PATCH 10/32] drm/nouveau: Fix crtc->primary->fb vs. drm_fb fail ville.syrjala
2016-11-17 16:14 ` [PATCH 11/32] drm/nouveau: Add local 'fb' variables ville.syrjala
2016-11-17 16:14 ` [PATCH 12/32] drm/vmwgfx: Populate fb->dev before drm_framebuffer_init() ville.syrjala
2016-11-17 16:14 ` [PATCH 13/32] drm: Pass 'dev' to drm_helper_mode_fill_fb_struct() ville.syrjala
2016-11-17 17:41   ` Laurent Pinchart
2016-11-17 16:14 ` [PATCH 14/32] drm/vmwgfx: Populate fb->pixel_format ville.syrjala
2016-11-17 17:52   ` Laurent Pinchart
2016-11-17 19:27     ` Ville Syrjälä
2016-11-17 16:14 ` [PATCH 15/32] drm/qxl: Call drm_helper_mode_fill_fb_struct() before drm_framebuffer_init() ville.syrjala
2016-11-17 16:14 ` [PATCH 16/32] drm/virtio: " ville.syrjala
2016-11-17 16:14 ` [PATCH 17/32] drm/i915: Set fb->dev early on for inherited fbs ville.syrjala
2016-11-17 16:14 ` [PATCH 18/32] drm: Populate fb->dev from drm_helper_mode_fill_fb_struct() ville.syrjala
2016-11-17 17:43   ` Laurent Pinchart
2016-11-17 16:14 ` [PATCH 19/32] drm: Store a pointer to drm_format_info under drm_framebuffer ville.syrjala
2016-11-17 17:57   ` Laurent Pinchart
2016-11-17 18:06     ` Ville Syrjälä
2016-11-17 18:13       ` Ville Syrjälä
2016-11-17 18:16         ` Laurent Pinchart
2016-11-17 16:14 ` [PATCH 20/32] drm/vmwgfx: Populate fb->format correctly ville.syrjala
2016-11-17 16:14 ` [PATCH 21/32] drm/i915: Populate fb->format early for inherited fbs ville.syrjala
2016-11-17 16:14 ` [PATCH 22/32] drm/atomic: Replace drm_format_num_planes() with fb->format->num_planes ville.syrjala
2016-11-17 17:58   ` Laurent Pinchart
2016-11-17 16:14 ` [PATCH 23/32] drm/fb_cma_helper: Replace drm_format_info() with fb->format ville.syrjala
2016-11-17 17:58   ` Laurent Pinchart
2016-11-17 16:14 ` [PATCH 24/32] drm/nouveau: Use fb->format rather than drm_format_info() ville.syrjala
2016-11-17 16:14 ` [PATCH 25/32] drm/i915: Store a pointer to the pixel format info for fbc ville.syrjala
2016-11-17 16:14 ` [PATCH 26/32] drm/i915: Replace drm_format_plane_cpp() with fb->format->cpp[] ville.syrjala
2016-11-17 16:14 ` [PATCH 27/32] drm/i915: Replace drm_format_num_planes() with fb->format->num_planes ville.syrjala
2016-11-17 16:14 ` [PATCH 28/32] drm: Add drm_framebuffer_plane_{width,height}() ville.syrjala
2016-11-17 16:14 ` [PATCH 29/32] drm/i915: Use drm_framebuffer_plane_{width, height}() where possible ville.syrjala
2016-11-17 16:14 ` [PATCH 30/32] drm: Nuke fb->depth ville.syrjala
2016-11-17 18:03   ` Laurent Pinchart
2016-11-17 16:14 ` [PATCH 31/32] drm: Nuke fb->bits_per_pixel ville.syrjala
2016-11-17 18:14   ` Laurent Pinchart
2016-11-17 18:35     ` Ville Syrjälä
2016-11-17 18:41       ` Laurent Pinchart
2016-11-17 19:18   ` [PATCH v2 " ville.syrjala
2016-11-17 16:14 ` [PATCH 32/32] drm: Nuke fb->pixel_format ville.syrjala
2016-11-17 17:37   ` Alex Deucher
2016-11-17 18:39   ` Laurent Pinchart [this message]

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=10276742.VRT1PEbuap@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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).