]> git.baikalelectronics.ru Git - kernel.git/commit
drm: Remove users of drm_format_num_planes
authorMaxime Ripard <maxime.ripard@bootlin.com>
Thu, 16 May 2019 10:31:47 +0000 (12:31 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Mon, 20 May 2019 11:32:57 +0000 (13:32 +0200)
commitdae048174c2177bc2467a1b78388e58b6a936341
treefa4f69082136940db1c9926107ec3e76d1575fb3
parent7df649163fb58aedaba22fb556de09de5f021dda
drm: Remove users of drm_format_num_planes

drm_format_num_planes() is basically a lookup in the drm_format_info table
plus an access to the num_planes field 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 drm_format_num_planes 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.

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/5ffcec9d14a50ed538e37d565f546802452ee672.1558002671.git-series.maxime.ripard@bootlin.com
14 files changed:
drivers/gpu/drm/arm/malidp_mw.c
drivers/gpu/drm/armada/armada_fb.c
drivers/gpu/drm/drm_fourcc.c
drivers/gpu/drm/mediatek/mtk_drm_fb.c
drivers/gpu/drm/meson/meson_overlay.c
drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
drivers/gpu/drm/msm/disp/mdp5/mdp5_smp.c
drivers/gpu/drm/msm/msm_fb.c
drivers/gpu/drm/omapdrm/omap_fb.c
drivers/gpu/drm/rockchip/rockchip_drm_fb.c
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/vc4/vc4_plane.c
drivers/gpu/drm/zte/zx_plane.c
include/drm/drm_fourcc.h