[PATCH 23/37] drm: Replace drm_format_num_planes() with fb->format->num_planes

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sat Nov 19 02:41:04 UTC 2016


Hi Ville,

Thank you for the patch.

On Friday 18 Nov 2016 21:52:59 ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Replace drm_format_num_planes(fb->pixel_format) with just
> fb->format->num_planes. Avoids the expensive format info lookup.
> 
> @@
> struct drm_framebuffer *a;
> struct drm_framebuffer b;
> @@
> (
> - drm_format_num_planes(a->pixel_format)
> + a->format->num_planes
> 
> - drm_format_num_planes(b.pixel_format)
> + b.format->num_planes
> )
> 
> @@
> struct drm_plane_state *a;
> struct drm_plane_state b;
> @@
> (
> - drm_format_num_planes(a->fb->pixel_format)
> + a->fb->format->num_planes
> 
> - drm_format_num_planes(b.fb->pixel_format)
> + b.fb->format->num_planes
> )
> 
> @@
> struct drm_framebuffer *a;
> identifier T;
> @@
>   T = a->pixel_format
> <+...
> - drm_format_num_planes(T)
> + a->format->num_planes
> ...+>
> 
> @@
> struct drm_framebuffer b;
> identifier T;
> @@
>   T = b.pixel_format
> <+...
> - drm_format_num_planes(T)
> + b.format->num_planes
> ...+>
> 
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Suggested-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  drivers/gpu/drm/arm/malidp_planes.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 | 2 +-
>  drivers/gpu/drm/drm_atomic.c                    | 2 +-
>  drivers/gpu/drm/i915/intel_display.c            | 2 +-
>  drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c       | 2 +-
>  drivers/gpu/drm/msm/msm_fb.c                    | 8 ++++----
>  drivers/gpu/drm/omapdrm/omap_fb.c               | 8 ++++----
>  drivers/gpu/drm/tegra/dc.c                      | 4 ++--
>  drivers/gpu/drm/tegra/fb.c                      | 2 +-
>  drivers/gpu/drm/vc4/vc4_plane.c                 | 2 +-
>  12 files changed, 19 insertions(+), 19 deletions(-)

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list