[5/8] drm/bochs: phase 3: use atomic .set_config helper
diff mbox

Message ID 1437049241-11972-6-git-send-email-zhjwpku@gmail.com
State New
Headers show

Commit Message

John Hunter July 16, 2015, 12:20 p.m. UTC
From: Zhao Junwang <zhjwpku@gmail.com>

Now that phase 1 and phase 2 are complete, switch .set_config helper
to use the atomic one.

-since .prepare() callbacks are no more needed, remove them
-.mode_set() and .mode_set_base() are no longer needed, remove

-as we are not using the transitional helper now, we can use the
 drm_atomic_helper_plane_check_update this time.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Zhao Junwang <zhjwpku@gmail.com>
---
 drivers/gpu/drm/bochs/bochs_kms.c |   24 ++++++++++--------------
 1 file changed, 10 insertions(+), 14 deletions(-)

Patch
diff mbox

diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c
index 2d2de7c..f0e93e1 100644
--- a/drivers/gpu/drm/bochs/bochs_kms.c
+++ b/drivers/gpu/drm/bochs/bochs_kms.c
@@ -50,10 +50,6 @@  static void bochs_crtc_mode_set_nofb(struct drm_crtc *crtc)
 	bochs_hw_setmode(bochs, &crtc->mode);
 }
 
-static void bochs_crtc_prepare(struct drm_crtc *crtc)
-{
-}
-
 static void bochs_crtc_commit(struct drm_crtc *crtc)
 {
 }
@@ -86,7 +82,7 @@  static int bochs_crtc_page_flip(struct drm_crtc *crtc,
 /* These provide the minimum set of functions required to handle a CRTC */
 static const struct drm_crtc_funcs bochs_crtc_funcs = {
 	.gamma_set = bochs_crtc_gamma_set,
-	.set_config = drm_crtc_helper_set_config,
+	.set_config = drm_atomic_helper_set_config,
 	.destroy = drm_crtc_cleanup,
 	.page_flip = bochs_crtc_page_flip,
 	.reset = drm_atomic_helper_crtc_reset,
@@ -97,10 +93,7 @@  static const struct drm_crtc_funcs bochs_crtc_funcs = {
 static const struct drm_crtc_helper_funcs bochs_helper_funcs = {
 	.dpms = bochs_crtc_dpms,
 	.mode_fixup = bochs_crtc_mode_fixup,
-	.mode_set = drm_helper_crtc_mode_set,
-	.mode_set_base = drm_helper_crtc_mode_set_base,
 	.mode_set_nofb = bochs_crtc_mode_set_nofb,
-	.prepare = bochs_crtc_prepare,
 	.commit = bochs_crtc_commit,
 };
 
@@ -162,7 +155,15 @@  static void bochs_plane_cleanup_fb(struct drm_plane *plane,
 static int bochs_plane_atomic_check(struct drm_plane *plane,
 			    struct drm_plane_state *plane_state)
 {
-	return 0;
+	bool visible;
+
+	if (!plane_state->fb)
+		return 0;
+
+	return drm_atomic_helper_plane_check_update(plane_state,
+					    DRM_PLANE_HELPER_NO_SCALING,
+					    DRM_PLANE_HELPER_NO_SCALING,
+					    false, &visible);
 }
 
 static void bochs_plane_atomic_update(struct drm_plane *plane,
@@ -227,10 +228,6 @@  static void bochs_encoder_dpms(struct drm_encoder *encoder, int state)
 {
 }
 
-static void bochs_encoder_prepare(struct drm_encoder *encoder)
-{
-}
-
 static void bochs_encoder_commit(struct drm_encoder *encoder)
 {
 }
@@ -239,7 +236,6 @@  static const struct drm_encoder_helper_funcs bochs_encoder_helper_funcs = {
 	.dpms = bochs_encoder_dpms,
 	.mode_fixup = bochs_encoder_mode_fixup,
 	.mode_set = bochs_encoder_mode_set,
-	.prepare = bochs_encoder_prepare,
 	.commit = bochs_encoder_commit,
 };