diff options
| author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-12-14 16:30:57 -0500 |
|---|---|---|
| committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-12-15 07:55:31 -0500 |
| commit | 353c859899635ea911f6476a0194c7a32c0c09c2 (patch) | |
| tree | 7cbc7c39a71dc766e603c97cb235dfe5b672a131 /drivers/gpu/drm/imx | |
| parent | 8305494e1ee938c96e15361b01fe15c3f4fc0d76 (diff) | |
drm: Replace drm_format_plane_cpp() with fb->format->cpp[]
Replace drm_format_plane_cpp(fb->pixel_format) with just
fb->format->cpp[]. Avoids the expensive format info lookup.
@@
struct drm_framebuffer *a;
struct drm_framebuffer b;
expression E;
@@
(
- drm_format_plane_cpp(a->pixel_format, E)
+ a->format->cpp[E]
|
- drm_format_plane_cpp(b.pixel_format, E)
+ b.format->cpp[E]
)
@@
struct drm_plane_state *a;
struct drm_plane_state b;
expression E;
@@
(
- drm_format_plane_cpp(a->fb->pixel_format, E)
+ a->fb->format->cpp[E]
|
- drm_format_plane_cpp(b.fb->pixel_format, E)
+ b.fb->format->cpp[E]
)
@@
struct drm_framebuffer *a;
identifier T;
expression E;
@@
T = a->pixel_format
<+...
- drm_format_plane_cpp(T, E)
+ a->format->cpp[E]
...+>
@@
struct drm_framebuffer b;
identifier T;
expression E;
@@
T = b.pixel_format
<+...
- drm_format_plane_cpp(T, E)
+ b.format->cpp[E]
...+>
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/1481751057-18123-1-git-send-email-ville.syrjala@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/imx')
| -rw-r--r-- | drivers/gpu/drm/imx/ipuv3-plane.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c index e74a0ad52950..f44a83656310 100644 --- a/drivers/gpu/drm/imx/ipuv3-plane.c +++ b/drivers/gpu/drm/imx/ipuv3-plane.c | |||
| @@ -77,7 +77,7 @@ drm_plane_state_to_eba(struct drm_plane_state *state) | |||
| 77 | BUG_ON(!cma_obj); | 77 | BUG_ON(!cma_obj); |
| 78 | 78 | ||
| 79 | return cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y + | 79 | return cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y + |
| 80 | drm_format_plane_cpp(fb->pixel_format, 0) * x; | 80 | fb->format->cpp[0] * x; |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | static inline unsigned long | 83 | static inline unsigned long |
| @@ -96,7 +96,7 @@ drm_plane_state_to_ubo(struct drm_plane_state *state) | |||
| 96 | y /= drm_format_vert_chroma_subsampling(fb->pixel_format); | 96 | y /= drm_format_vert_chroma_subsampling(fb->pixel_format); |
| 97 | 97 | ||
| 98 | return cma_obj->paddr + fb->offsets[1] + fb->pitches[1] * y + | 98 | return cma_obj->paddr + fb->offsets[1] + fb->pitches[1] * y + |
| 99 | drm_format_plane_cpp(fb->pixel_format, 1) * x - eba; | 99 | fb->format->cpp[1] * x - eba; |
| 100 | } | 100 | } |
| 101 | 101 | ||
| 102 | static inline unsigned long | 102 | static inline unsigned long |
| @@ -115,7 +115,7 @@ drm_plane_state_to_vbo(struct drm_plane_state *state) | |||
| 115 | y /= drm_format_vert_chroma_subsampling(fb->pixel_format); | 115 | y /= drm_format_vert_chroma_subsampling(fb->pixel_format); |
| 116 | 116 | ||
| 117 | return cma_obj->paddr + fb->offsets[2] + fb->pitches[2] * y + | 117 | return cma_obj->paddr + fb->offsets[2] + fb->pitches[2] * y + |
| 118 | drm_format_plane_cpp(fb->pixel_format, 2) * x - eba; | 118 | fb->format->cpp[2] * x - eba; |
| 119 | } | 119 | } |
| 120 | 120 | ||
| 121 | void ipu_plane_put_resources(struct ipu_plane *ipu_plane) | 121 | void ipu_plane_put_resources(struct ipu_plane *ipu_plane) |
