drm/exynos: atomic phase 2: wire up state reset(), duplicate() and destroy()
authorGustavo Padovan <gustavo.padovan@collabora.co.uk>
Mon, 1 Jun 2015 15:04:44 +0000 (12:04 -0300)
committerInki Dae <daeinki@gmail.com>
Fri, 19 Jun 2015 15:32:48 +0000 (00:32 +0900)
Set CRTC, planes and connectors to use the default implementations from
the atomic helper library. The helpers will work to keep track of state
for each DRM object.

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>
drivers/gpu/drm/bridge/ps8622.c
drivers/gpu/drm/bridge/ptn3460.c
drivers/gpu/drm/exynos/exynos_dp_core.c
drivers/gpu/drm/exynos/exynos_drm_crtc.c
drivers/gpu/drm/exynos/exynos_drm_dpi.c
drivers/gpu/drm/exynos/exynos_drm_drv.c
drivers/gpu/drm/exynos/exynos_drm_dsi.c
drivers/gpu/drm/exynos/exynos_drm_plane.c
drivers/gpu/drm/exynos/exynos_drm_vidi.c
drivers/gpu/drm/exynos/exynos_hdmi.c

index 32c4601141dea09803d9b4fa0e75909fc7b48318..4043a0f1562917f9ee9f180e806b0b4d32b8a6e1 100644 (file)
@@ -32,6 +32,7 @@
 #include "drmP.h"
 #include "drm_crtc.h"
 #include "drm_crtc_helper.h"
+#include "drm_atomic_helper.h"
 
 /* Brightness scale on the Parade chip */
 #define PS8622_MAX_BRIGHTNESS 0xff
@@ -503,6 +504,9 @@ static const struct drm_connector_funcs ps8622_connector_funcs = {
        .fill_modes = drm_helper_probe_single_connector_modes,
        .detect = ps8622_detect,
        .destroy = ps8622_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 int ps8622_attach(struct drm_bridge *bridge)
index 0e081564e70de5cd65e6df76b01f9bc58241b00a..737aa74a51c63ec61e6e27b234ad95fc4706ba60 100644 (file)
@@ -26,6 +26,7 @@
 
 #include "drm_crtc.h"
 #include "drm_crtc_helper.h"
+#include "drm_atomic_helper.h"
 #include "drm_edid.h"
 #include "drmP.h"
 
@@ -262,6 +263,9 @@ static struct drm_connector_funcs ptn3460_connector_funcs = {
        .fill_modes = drm_helper_probe_single_connector_modes,
        .detect = ptn3460_detect,
        .destroy = ptn3460_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 int ptn3460_bridge_attach(struct drm_bridge *bridge)
index 15b0865ecf97fe939f832df9ecb547358c8dc416..b8dd3e91fe190e63665e71f71268b4f72bd69c8a 100644 (file)
@@ -28,6 +28,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_panel.h>
 
 #include "exynos_dp_core.h"
@@ -956,6 +957,9 @@ static struct drm_connector_funcs exynos_dp_connector_funcs = {
        .fill_modes = drm_helper_probe_single_connector_modes,
        .detect = exynos_dp_detect,
        .destroy = exynos_dp_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 int exynos_dp_get_modes(struct drm_connector *connector)
index 75eb61b201cad89574f201ec241ca76e2e15c4eb..73ccfa70d1ef5e49ef6a856da7785a1a50e144fc 100644 (file)
@@ -14,6 +14,8 @@
 
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
 
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_drv.h"
@@ -188,6 +190,9 @@ static struct drm_crtc_funcs exynos_crtc_funcs = {
        .set_config     = drm_crtc_helper_set_config,
        .page_flip      = exynos_drm_crtc_page_flip,
        .destroy        = exynos_drm_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,
 };
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
index 37678cf4425ad515eaac8a6c244cd53a5ced3c5e..ced5c236365dd1664212af4f02d863481b4d570e 100644 (file)
@@ -13,6 +13,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_panel.h>
+#include <drm/drm_atomic_helper.h>
 
 #include <linux/regulator/consumer.h>
 
@@ -63,6 +64,9 @@ static struct drm_connector_funcs exynos_dpi_connector_funcs = {
        .detect = exynos_dpi_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = exynos_dpi_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 int exynos_dpi_get_modes(struct drm_connector *connector)
index 8ac465208eae1df44a10aac219e27a3ee683806d..08b9a8caadb7b389bb503ef79527704f0f1ace78 100644 (file)
@@ -98,6 +98,8 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
        if (ret)
                goto err_cleanup_vblank;
 
+       drm_mode_config_reset(dev);
+
        /*
         * enable drm irq mode.
         * - with irq_enabled = true, we can use the vblank feature.
index 04927153bf38dedcd70546ec3e41b2159c72083e..e4e7f749921c2edfc4d5649ef0e1ff7981e8fa54 100644 (file)
@@ -14,6 +14,7 @@
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_mipi_dsi.h>
 #include <drm/drm_panel.h>
+#include <drm/drm_atomic_helper.h>
 
 #include <linux/clk.h>
 #include <linux/gpio/consumer.h>
@@ -1461,6 +1462,9 @@ static struct drm_connector_funcs exynos_dsi_connector_funcs = {
        .detect = exynos_dsi_detect,
        .fill_modes = drm_helper_probe_single_connector_modes,
        .destroy = exynos_dsi_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 int exynos_dsi_get_modes(struct drm_connector *connector)
index f0067f785c6e0645be5278f206c3ddf07ef3c759..42fcaca7087b33eb35eaf21b1bb8647cf0392b18 100644 (file)
@@ -13,6 +13,7 @@
 
 #include <drm/exynos_drm.h>
 #include <drm/drm_plane_helper.h>
+#include <drm/drm_atomic_helper.h>
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
 #include "exynos_drm_fb.h"
@@ -170,6 +171,9 @@ static struct drm_plane_funcs exynos_plane_funcs = {
        .update_plane   = drm_plane_helper_update,
        .disable_plane  = drm_plane_helper_disable,
        .destroy        = drm_plane_cleanup,
+       .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 int exynos_plane_atomic_check(struct drm_plane *plane,
index 1b3479a8db5f08dd2b3c1c4fa0de5758d2ae7b26..fc3a14b3eccfc5be3b0a1aac413983f8a48c766b 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <drm/drm_edid.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_atomic_helper.h>
 
 #include "exynos_drm_drv.h"
 #include "exynos_drm_crtc.h"
@@ -388,6 +389,9 @@ static struct drm_connector_funcs vidi_connector_funcs = {
        .fill_modes = drm_helper_probe_single_connector_modes,
        .detect = vidi_detect,
        .destroy = vidi_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 int vidi_get_modes(struct drm_connector *connector)
index 5eba971f394a454b9cab53ff023bb4a74e63d826..471e4860ead0e99a61615acc0bbca0c694f0b8b8 100644 (file)
@@ -17,6 +17,7 @@
 #include <drm/drmP.h>
 #include <drm/drm_edid.h>
 #include <drm/drm_crtc_helper.h>
+#include <drm/drm_atomic_helper.h>
 
 #include "regs-hdmi.h"
 
@@ -1054,6 +1055,9 @@ static struct drm_connector_funcs hdmi_connector_funcs = {
        .fill_modes = drm_helper_probe_single_connector_modes,
        .detect = hdmi_detect,
        .destroy = hdmi_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 int hdmi_get_modes(struct drm_connector *connector)
This page took 0.031268 seconds and 5 git commands to generate.