[PATCH 2/7] drm/cirrus: phase 2: wire up state reset, duplicate and destroy

John Hunter zhjwpku at gmail.com
Wed Aug 5 00:22:51 PDT 2015


From: Zhao Junwang <zhjwpku at gmail.com>

Set CRTC, planes and connectors to use the default implementations
from the atomic helper library.

Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: Matthew Garrett <mjg59 at coreos.com>
Cc: Dave Airlie <airlied at redhat.com>
Signed-off-by: Zhao Junwang <zhjwpku at gmail.com>
---
 drivers/gpu/drm/cirrus/cirrus_mode.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c
index 7a7c874..42a4d86 100644
--- a/drivers/gpu/drm/cirrus/cirrus_mode.c
+++ b/drivers/gpu/drm/cirrus/cirrus_mode.c
@@ -17,6 +17,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_plane_helper.h>
+#include <drm/drm_atomic_helper.h>
 
 #include <video/cirrus.h>
 
@@ -304,6 +305,9 @@ static const struct drm_crtc_funcs cirrus_crtc_funcs = {
 	.gamma_set = cirrus_crtc_gamma_set,
 	.set_config = drm_crtc_helper_set_config,
 	.destroy = cirrus_crtc_destroy,
+	.reset = drm_atomic_helper_crtc_reset,
+	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
 };
 
 static const struct drm_crtc_helper_funcs cirrus_helper_funcs = {
@@ -429,6 +433,9 @@ static void cirrus_plane_atomic_disable(struct drm_plane *plane,
 static const struct drm_plane_funcs cirrus_plane_funcs = {
 	.update_plane = drm_plane_helper_update,
 	.disable_plane = drm_plane_helper_disable,
+	.reset = drm_atomic_helper_plane_reset,
+	.atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
 };
 
 static const struct drm_plane_helper_funcs cirrus_plane_helper_funcs = {
@@ -593,6 +600,9 @@ struct drm_connector_funcs cirrus_vga_connector_funcs = {
 	.detect = cirrus_vga_detect,
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.destroy = cirrus_connector_destroy,
+	.reset = drm_atomic_helper_connector_reset,
+	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
 };
 
 static struct drm_connector *cirrus_vga_init(struct drm_device *dev)
@@ -648,6 +658,8 @@ int cirrus_modeset_init(struct cirrus_device *cdev)
 		return -1;
 	}
 
+	drm_mode_config_reset(cdev->dev);
+
 	drm_mode_connector_attach_encoder(connector, encoder);
 
 	ret = cirrus_fbdev_init(cdev);
-- 
1.7.10.4




More information about the dri-devel mailing list