summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/arm/malidp_mw.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@bootlin.com>2019-05-16 13:31:47 +0300
committerMaxime Ripard <maxime.ripard@bootlin.com>2019-05-20 14:32:57 +0300
commit05c452c115bffa12f78346723f0282a4264ed200 (patch)
treefa4f69082136940db1c9926107ec3e76d1575fb3 /drivers/gpu/drm/arm/malidp_mw.c
parent45babef01f92f1c3ab3012dfb7e98ae51f1ebeab (diff)
downloadlinux-05c452c115bffa12f78346723f0282a4264ed200.tar.xz
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
Diffstat (limited to 'drivers/gpu/drm/arm/malidp_mw.c')
-rw-r--r--drivers/gpu/drm/arm/malidp_mw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c
index 5f102bdaf841..2e812525025d 100644
--- a/drivers/gpu/drm/arm/malidp_mw.c
+++ b/drivers/gpu/drm/arm/malidp_mw.c
@@ -158,7 +158,7 @@ malidp_mw_encoder_atomic_check(struct drm_encoder *encoder,
return -EINVAL;
}
- n_planes = drm_format_num_planes(fb->format->format);
+ n_planes = fb->format->num_planes;
for (i = 0; i < n_planes; i++) {
struct drm_gem_cma_object *obj = drm_fb_cma_get_gem_obj(fb, i);
/* memory write buffers are never rotated */