]> asedeno.scripts.mit.edu Git - linux.git/commit
drm: Remove users of drm_format_(horz|vert)_chroma_subsampling
authorMaxime Ripard <maxime.ripard@bootlin.com>
Thu, 16 May 2019 10:31:48 +0000 (12:31 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 20 May 2019 11:33:11 +0000 (13:33 +0200)
commitf3e9632cb6241a6c098427510ad3ee041365ae64
tree60a1e4318a180b4281da1e31d8aed53497018621
parent05c452c115bffa12f78346723f0282a4264ed200
drm: Remove users of drm_format_(horz|vert)_chroma_subsampling

drm_format_horz_chroma_subsampling and drm_format_vert_chroma_subsampling
are basically a lookup in the drm_format_info table plus an access to the
hsub and vsub fields of the appropriate entry.

Most drivers are using this function while having access to the entry
already, which means that we will perform an unnecessary lookup. Removing
the call to these functions is therefore more efficient.

Some drivers will not have access to that entry in the function, but in
this case the overhead is minimal (we just have to call drm_format_info()
to perform the lookup) and we can even avoid multiple, inefficient lookups
in some places that need multiple fields from the drm_format_info
structure.

This is amplified by the fact that most of the time the callers will have
to retrieve both the vsub and hsub fields, meaning that they would perform
twice the lookup.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/6b3cceb8161e2c1d40c2681de99202328b0a8abc.1558002671.git-series.maxime.ripard@bootlin.com
13 files changed:
drivers/gpu/drm/arm/malidp_planes.c
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
drivers/gpu/drm/drm_fourcc.c
drivers/gpu/drm/imx/ipuv3-plane.c
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_plane.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
drivers/gpu/drm/msm/msm_fb.c
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
drivers/gpu/drm/rockchip/rockchip_drm_vop.c
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/vc4/vc4_plane.c
include/drm/drm_fourcc.h