[PATCH 21/70] drm/simple-kms: Remove unused reset_crtc hook

Maxime Ripard <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
The reset_crtc hook in drm_simple_display_pipe_funcs allows simple
KMS drivers to provide a custom CRTC reset implementation. However,
no driver ever implemented it.

Remove the hook and the wrapper function, and use
drm_atomic_helper_crtc_reset() directly.

Signed-off-by: Maxime Ripard <[email protected]>
---
 drivers/gpu/drm/drm_simple_kms_helper.c | 13 +------------
 include/drm/drm_simple_kms_helper.h     |  1 -
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/drm_simple_kms_helper.c b/drivers/gpu/drm/drm_simple_kms_helper.c
index 8e1d07b9f1e3..6c77154dc54e 100644
--- a/drivers/gpu/drm/drm_simple_kms_helper.c
+++ b/drivers/gpu/drm/drm_simple_kms_helper.c
@@ -100,21 +100,10 @@ static const struct drm_crtc_helper_funcs drm_simple_kms_crtc_helper_funcs = {
 	.atomic_check = drm_simple_kms_crtc_check,
 	.atomic_enable = drm_simple_kms_crtc_enable,
 	.atomic_disable = drm_simple_kms_crtc_disable,
 };
 
-static void drm_simple_kms_crtc_reset(struct drm_crtc *crtc)
-{
-	struct drm_simple_display_pipe *pipe;
-
-	pipe = container_of(crtc, struct drm_simple_display_pipe, crtc);
-	if (!pipe->funcs || !pipe->funcs->reset_crtc)
-		return drm_atomic_helper_crtc_reset(crtc);
-
-	return pipe->funcs->reset_crtc(pipe);
-}
-
 static struct drm_crtc_state *drm_simple_kms_crtc_duplicate_state(struct drm_crtc *crtc)
 {
 	struct drm_simple_display_pipe *pipe;
 
 	pipe = container_of(crtc, struct drm_simple_display_pipe, crtc);
@@ -156,11 +145,11 @@ static void drm_simple_kms_crtc_disable_vblank(struct drm_crtc *crtc)
 
 	pipe->funcs->disable_vblank(pipe);
 }
 
 static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = {
-	.reset = drm_simple_kms_crtc_reset,
+	.reset = drm_atomic_helper_crtc_reset,
 	.destroy = drm_crtc_cleanup,
 	.set_config = drm_atomic_helper_set_config,
 	.page_flip = drm_atomic_helper_page_flip,
 	.atomic_duplicate_state = drm_simple_kms_crtc_duplicate_state,
 	.atomic_destroy_state = drm_simple_kms_crtc_destroy_state,
diff --git a/include/drm/drm_simple_kms_helper.h b/include/drm/drm_simple_kms_helper.h
index cb672ce0e856..8421af764f02 100644
--- a/include/drm/drm_simple_kms_helper.h
+++ b/include/drm/drm_simple_kms_helper.h
@@ -37,11 +37,10 @@ struct drm_simple_display_pipe_funcs {
 			       struct drm_plane_state *new_plane_state);
 	void (*end_fb_access)(struct drm_simple_display_pipe *pipe,
 			      struct drm_plane_state *plane_state);
 	int (*enable_vblank)(struct drm_simple_display_pipe *pipe);
 	void (*disable_vblank)(struct drm_simple_display_pipe *pipe);
-	void (*reset_crtc)(struct drm_simple_display_pipe *pipe);
 	struct drm_crtc_state * (*duplicate_crtc_state)(struct drm_simple_display_pipe *pipe);
 	void (*destroy_crtc_state)(struct drm_simple_display_pipe *pipe,
 				   struct drm_crtc_state *crtc_state);
 	void (*reset_plane)(struct drm_simple_display_pipe *pipe);
 	struct drm_plane_state * (*duplicate_plane_state)(struct drm_simple_display_pipe *pipe);

-- 
2.55.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.