diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-12-14 16:30:22 -0500 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-12-15 07:55:31 -0500 |
commit | bcb0b461454c9cb3b5804cf75bacaadb52348864 (patch) | |
tree | 7e39137ebadcd22faa9cea37eba384f33a63f507 /drivers/gpu/drm/omapdrm/omap_fb.c | |
parent | 570cec3244447f21f5b24c3a75151b4166e30d95 (diff) |
drm: Replace drm_format_num_planes() with fb->format->num_planes
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
...+>
v2: Rerun spatch due to code changes
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1481751022-18015-1-git-send-email-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fb.c')
-rw-r--r-- | drivers/gpu/drm/omapdrm/omap_fb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fb.c b/drivers/gpu/drm/omapdrm/omap_fb.c index 9875c99be009..c6ef457b9fca 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, | |||
107 | static void omap_framebuffer_destroy(struct drm_framebuffer *fb) | 107 | static void omap_framebuffer_destroy(struct drm_framebuffer *fb) |
108 | { | 108 | { |
109 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); | 109 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); |
110 | int i, n = drm_format_num_planes(fb->pixel_format); | 110 | int i, n = fb->format->num_planes; |
111 | 111 | ||
112 | DBG("destroy: FB ID: %d (%p)", fb->base.id, fb); | 112 | DBG("destroy: FB ID: %d (%p)", fb->base.id, fb); |
113 | 113 | ||
@@ -252,7 +252,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, | |||
252 | int omap_framebuffer_pin(struct drm_framebuffer *fb) | 252 | int omap_framebuffer_pin(struct drm_framebuffer *fb) |
253 | { | 253 | { |
254 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); | 254 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); |
255 | int ret, i, n = drm_format_num_planes(fb->pixel_format); | 255 | int ret, i, n = fb->format->num_planes; |
256 | 256 | ||
257 | mutex_lock(&omap_fb->lock); | 257 | mutex_lock(&omap_fb->lock); |
258 | 258 | ||
@@ -292,7 +292,7 @@ fail: | |||
292 | void omap_framebuffer_unpin(struct drm_framebuffer *fb) | 292 | void omap_framebuffer_unpin(struct drm_framebuffer *fb) |
293 | { | 293 | { |
294 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); | 294 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); |
295 | int i, n = drm_format_num_planes(fb->pixel_format); | 295 | int i, n = fb->format->num_planes; |
296 | 296 | ||
297 | mutex_lock(&omap_fb->lock); | 297 | mutex_lock(&omap_fb->lock); |
298 | 298 | ||
@@ -343,7 +343,7 @@ struct drm_connector *omap_framebuffer_get_next_connector( | |||
343 | void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) | 343 | void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m) |
344 | { | 344 | { |
345 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); | 345 | struct omap_framebuffer *omap_fb = to_omap_framebuffer(fb); |
346 | int i, n = drm_format_num_planes(fb->pixel_format); | 346 | int i, n = fb->format->num_planes; |
347 | 347 | ||
348 | seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height, | 348 | seq_printf(m, "fb: %dx%d@%4.4s\n", fb->width, fb->height, |
349 | (char *)&fb->pixel_format); | 349 | (char *)&fb->pixel_format); |