Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/exynos: remove exported functions from exynos_drm_plane

Now that no one is using the functions exported by exynos_drm_plane due
to the atomic conversion we can make remove some of the them or make them
static.

v2: remove unused exynos_drm_crtc

v3: fix checkpatch error (reported by Joonyoung)

Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com>
Tested-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Signed-off-by: Inki Dae <inki.dae@samsung.com>

authored by

Gustavo Padovan and committed by
Inki Dae
d5f5223c 9d5ab6a0

+42 -67
+42 -56
drivers/gpu/drm/exynos/exynos_drm_plane.c
··· 62 62 return size; 63 63 } 64 64 65 - int exynos_check_plane(struct drm_plane *plane, struct drm_framebuffer *fb) 66 - { 67 - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); 68 - int nr; 69 - int i; 70 - 71 - if (!fb) 72 - return 0; 73 - 74 - nr = exynos_drm_fb_get_buf_cnt(fb); 75 - for (i = 0; i < nr; i++) { 76 - struct exynos_drm_gem_buf *buffer = exynos_drm_fb_buffer(fb, i); 77 - 78 - if (!buffer) { 79 - DRM_DEBUG_KMS("buffer is null\n"); 80 - return -EFAULT; 81 - } 82 - 83 - exynos_plane->dma_addr[i] = buffer->dma_addr + fb->offsets[i]; 84 - 85 - DRM_DEBUG_KMS("buffer: %d, dma_addr = 0x%lx\n", 86 - i, (unsigned long)exynos_plane->dma_addr[i]); 87 - } 88 - 89 - return 0; 90 - } 91 - 92 - void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, 93 - struct drm_framebuffer *fb, int crtc_x, int crtc_y, 94 - unsigned int crtc_w, unsigned int crtc_h, 95 - uint32_t src_x, uint32_t src_y, 96 - uint32_t src_w, uint32_t src_h) 65 + static void exynos_plane_mode_set(struct drm_plane *plane, 66 + struct drm_crtc *crtc, 67 + struct drm_framebuffer *fb, 68 + int crtc_x, int crtc_y, 69 + unsigned int crtc_w, unsigned int crtc_h, 70 + uint32_t src_x, uint32_t src_y, 71 + uint32_t src_w, uint32_t src_h) 97 72 { 98 73 struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); 99 74 struct drm_display_mode *mode = &crtc->state->adjusted_mode; ··· 124 149 plane->crtc = crtc; 125 150 } 126 151 127 - void 128 - exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, 129 - struct drm_framebuffer *fb, int crtc_x, int crtc_y, 130 - unsigned int crtc_w, unsigned int crtc_h, 131 - uint32_t src_x, uint32_t src_y, 132 - uint32_t src_w, uint32_t src_h) 133 - { 134 - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); 135 - struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); 136 - 137 - exynos_plane_mode_set(plane, crtc, fb, crtc_x, crtc_y, 138 - crtc_w, crtc_h, src_x >> 16, src_y >> 16, 139 - src_w >> 16, src_h >> 16); 140 - 141 - if (exynos_crtc->ops->win_commit) 142 - exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); 143 - } 144 - 145 152 static struct drm_plane_funcs exynos_plane_funcs = { 146 153 .update_plane = drm_atomic_helper_update_plane, 147 154 .disable_plane = drm_atomic_helper_disable_plane, ··· 136 179 static int exynos_plane_atomic_check(struct drm_plane *plane, 137 180 struct drm_plane_state *state) 138 181 { 139 - return exynos_check_plane(plane, state->fb); 182 + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); 183 + int nr; 184 + int i; 185 + 186 + if (!state->fb) 187 + return 0; 188 + 189 + nr = exynos_drm_fb_get_buf_cnt(state->fb); 190 + for (i = 0; i < nr; i++) { 191 + struct exynos_drm_gem_buf *buffer = 192 + exynos_drm_fb_buffer(state->fb, i); 193 + 194 + if (!buffer) { 195 + DRM_DEBUG_KMS("buffer is null\n"); 196 + return -EFAULT; 197 + } 198 + 199 + exynos_plane->dma_addr[i] = buffer->dma_addr + 200 + state->fb->offsets[i]; 201 + 202 + DRM_DEBUG_KMS("buffer: %d, dma_addr = 0x%lx\n", 203 + i, (unsigned long)exynos_plane->dma_addr[i]); 204 + } 205 + 206 + return 0; 140 207 } 141 208 142 209 static void exynos_plane_atomic_update(struct drm_plane *plane, 143 210 struct drm_plane_state *old_state) 144 211 { 145 212 struct drm_plane_state *state = plane->state; 213 + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(state->crtc); 214 + struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane); 146 215 147 216 if (!state->crtc) 148 217 return; 149 218 150 - exynos_update_plane(plane, state->crtc, state->fb, 151 - state->crtc_x, state->crtc_y, 152 - state->crtc_w, state->crtc_h, 153 - state->src_x, state->src_y, 154 - state->src_w, state->src_h); 219 + exynos_plane_mode_set(plane, state->crtc, state->fb, 220 + state->crtc_x, state->crtc_y, 221 + state->crtc_w, state->crtc_h, 222 + state->src_x >> 16, state->src_y >> 16, 223 + state->src_w >> 16, state->src_h >> 16); 224 + 225 + if (exynos_crtc->ops->win_commit) 226 + exynos_crtc->ops->win_commit(exynos_crtc, exynos_plane->zpos); 155 227 } 156 228 157 229 static void exynos_plane_atomic_disable(struct drm_plane *plane,
-11
drivers/gpu/drm/exynos/exynos_drm_plane.h
··· 9 9 * 10 10 */ 11 11 12 - int exynos_check_plane(struct drm_plane *plane, struct drm_framebuffer *fb); 13 - void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc, 14 - struct drm_framebuffer *fb, int crtc_x, int crtc_y, 15 - unsigned int crtc_w, unsigned int crtc_h, 16 - uint32_t src_x, uint32_t src_y, 17 - uint32_t src_w, uint32_t src_h); 18 - void exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc, 19 - struct drm_framebuffer *fb, int crtc_x, int crtc_y, 20 - unsigned int crtc_w, unsigned int crtc_h, 21 - uint32_t src_x, uint32_t src_y, 22 - uint32_t src_w, uint32_t src_h); 23 12 int exynos_plane_init(struct drm_device *dev, 24 13 struct exynos_drm_plane *exynos_plane, 25 14 unsigned long possible_crtcs, enum drm_plane_type type,