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

drm/simple-kms: Remove drm_gem_simple_display_pipe_prepare_fb()

The helper drm_gem_simple_display_pipe_prepare_fb() is simple-KMS'
default implementation for prepare_fb. Remove the call from drivers
that set it explicitly. Then inline the helper into the only caller
within simple-kms helpers. No functional changes.

Simple-KMS drivers that implement the prepare_fb callback should call
drm_gem_plane_helper_prepare_fb() directly.

v2:
* fix typo in commit message

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20221202125644.7917-2-tzimmermann@suse.de

+6 -39
+1 -30
drivers/gpu/drm/drm_gem_atomic_helper.c
··· 26 26 * call drm_gem_plane_helper_prepare_fb() from their implementation of 27 27 * struct &drm_plane_helper.prepare_fb . It sets the plane's fence from 28 28 * the framebuffer so that the DRM core can synchronize access automatically. 29 - * 30 29 * drm_gem_plane_helper_prepare_fb() can also be used directly as 31 - * implementation of prepare_fb. For drivers based on 32 - * struct drm_simple_display_pipe, drm_gem_simple_display_pipe_prepare_fb() 33 - * provides equivalent functionality. 30 + * implementation of prepare_fb. 34 31 * 35 32 * .. code-block:: c 36 33 * ··· 36 39 * struct drm_plane_helper_funcs driver_plane_helper_funcs = { 37 40 * ..., 38 41 * . prepare_fb = drm_gem_plane_helper_prepare_fb, 39 - * }; 40 - * 41 - * struct drm_simple_display_pipe_funcs driver_pipe_funcs = { 42 - * ..., 43 - * . prepare_fb = drm_gem_simple_display_pipe_prepare_fb, 44 42 * }; 45 43 * 46 44 * A driver using a shadow buffer copies the content of the shadow buffers ··· 196 204 return ret; 197 205 } 198 206 EXPORT_SYMBOL_GPL(drm_gem_plane_helper_prepare_fb); 199 - 200 - /** 201 - * drm_gem_simple_display_pipe_prepare_fb - prepare_fb helper for &drm_simple_display_pipe 202 - * @pipe: Simple display pipe 203 - * @plane_state: Plane state 204 - * 205 - * This function uses drm_gem_plane_helper_prepare_fb() to extract the fences 206 - * from &drm_gem_object.resv and attaches them to the plane state for the atomic 207 - * helper to wait on. This is necessary to correctly implement implicit 208 - * synchronization for any buffers shared as a struct &dma_buf. Drivers can use 209 - * this as their &drm_simple_display_pipe_funcs.prepare_fb callback. 210 - * 211 - * See drm_gem_plane_helper_prepare_fb() for a discussion of implicit and 212 - * explicit fencing in atomic modeset updates. 213 - */ 214 - int drm_gem_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe, 215 - struct drm_plane_state *plane_state) 216 - { 217 - return drm_gem_plane_helper_prepare_fb(&pipe->plane, plane_state); 218 - } 219 - EXPORT_SYMBOL(drm_gem_simple_display_pipe_prepare_fb); 220 207 221 208 /* 222 209 * Shadow-buffered Planes
+1 -1
drivers/gpu/drm/drm_simple_kms_helper.c
··· 267 267 268 268 WARN_ON_ONCE(pipe->funcs && pipe->funcs->cleanup_fb); 269 269 270 - return drm_gem_simple_display_pipe_prepare_fb(pipe, state); 270 + return drm_gem_plane_helper_prepare_fb(plane, state); 271 271 } 272 272 273 273 return pipe->funcs->prepare_fb(pipe, state);
-1
drivers/gpu/drm/panel/panel-ilitek-ili9341.c
··· 581 581 .enable = ili9341_dbi_enable, 582 582 .disable = mipi_dbi_pipe_disable, 583 583 .update = mipi_dbi_pipe_update, 584 - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, 585 584 }; 586 585 587 586 static const struct drm_display_mode ili9341_dbi_mode = {
-1
drivers/gpu/drm/tiny/ili9163.c
··· 104 104 .enable = yx240qv29_enable, 105 105 .disable = mipi_dbi_pipe_disable, 106 106 .update = mipi_dbi_pipe_update, 107 - .prepare_fb = drm_gem_simple_display_pipe_prepare_fb, 108 107 }; 109 108 110 109 static const struct drm_display_mode yx240qv29_mode = {
-2
include/drm/drm_gem_atomic_helper.h
··· 15 15 */ 16 16 17 17 int drm_gem_plane_helper_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state); 18 - int drm_gem_simple_display_pipe_prepare_fb(struct drm_simple_display_pipe *pipe, 19 - struct drm_plane_state *plane_state); 20 18 21 19 /* 22 20 * Helpers for planes with shadow buffers
+2 -2
include/drm/drm_plane.h
··· 77 77 * write this field directly for a driver's implicit fence. 78 78 * 79 79 * Drivers should store any implicit fence in this from their 80 - * &drm_plane_helper_funcs.prepare_fb callback. See drm_gem_plane_helper_prepare_fb() 81 - * and drm_gem_simple_display_pipe_prepare_fb() for suitable helpers. 80 + * &drm_plane_helper_funcs.prepare_fb callback. See 81 + * drm_gem_plane_helper_prepare_fb() for a suitable helper. 82 82 */ 83 83 struct dma_fence *fence; 84 84
+2 -2
include/drm/drm_simple_kms_helper.h
··· 117 117 * more details. 118 118 * 119 119 * For GEM drivers who neither have a @prepare_fb nor @cleanup_fb hook 120 - * set drm_gem_simple_display_pipe_prepare_fb() is called automatically 120 + * set, drm_gem_plane_helper_prepare_fb() is called automatically 121 121 * to implement this. Other drivers which need additional plane 122 - * processing can call drm_gem_simple_display_pipe_prepare_fb() from 122 + * processing can call drm_gem_plane_helper_prepare_fb() from 123 123 * their @prepare_fb hook. 124 124 */ 125 125 int (*prepare_fb)(struct drm_simple_display_pipe *pipe,