drm/tilcdc: Set DRIVER_ATOMIC and use atomic crtc helpers
authorJyri Sarha <jsarha@ti.com>
Thu, 7 Apr 2016 12:05:16 +0000 (15:05 +0300)
committerJyri Sarha <jsarha@ti.com>
Mon, 8 Aug 2016 20:05:07 +0000 (23:05 +0300)
Set DRIVER_ATOMIC and use atomic helpers and rename commit and prepare
crtc helpers to enable and disable. This makes the final jump to mode
setting, but there is lot of obsolete code to clean up.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
drivers/gpu/drm/tilcdc/tilcdc_crtc.c
drivers/gpu/drm/tilcdc/tilcdc_drv.c

index 3e272f9..9a21a7f 100644 (file)
@@ -17,6 +17,7 @@
 
 #include "drm_flip_work.h"
 #include <drm/drm_plane_helper.h>
+#include <drm/drm_atomic_helper.h>
 
 #include "tilcdc_drv.h"
 #include "tilcdc_regs.h"
@@ -293,12 +294,12 @@ static bool tilcdc_crtc_mode_fixup(struct drm_crtc *crtc,
        return true;
 }
 
-static void tilcdc_crtc_prepare(struct drm_crtc *crtc)
+static void tilcdc_crtc_disable(struct drm_crtc *crtc)
 {
        tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
 }
 
-static void tilcdc_crtc_commit(struct drm_crtc *crtc)
+static void tilcdc_crtc_enable(struct drm_crtc *crtc)
 {
        tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
 }
@@ -704,18 +705,23 @@ static int tilcdc_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
 }
 
 static const struct drm_crtc_funcs tilcdc_crtc_funcs = {
-               .destroy        = tilcdc_crtc_destroy,
-               .set_config     = drm_crtc_helper_set_config,
-               .page_flip      = tilcdc_crtc_page_flip,
+       .destroy        = tilcdc_crtc_destroy,
+       .set_config     = drm_atomic_helper_set_config,
+       .page_flip      = drm_atomic_helper_page_flip,
+       .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 tilcdc_crtc_helper_funcs = {
                .dpms           = tilcdc_crtc_dpms,
                .mode_fixup     = tilcdc_crtc_mode_fixup,
-               .prepare        = tilcdc_crtc_prepare,
-               .commit         = tilcdc_crtc_commit,
+               .prepare        = tilcdc_crtc_disable,
+               .commit         = tilcdc_crtc_enable,
                .mode_set       = tilcdc_crtc_mode_set,
                .mode_set_base  = tilcdc_crtc_mode_set_base,
+               .enable         = tilcdc_crtc_enable,
+               .disable        = tilcdc_crtc_disable,
                .atomic_check   = tilcdc_crtc_atomic_check,
                .mode_set_nofb  = tilcdc_crtc_mode_set_nofb,
 };
index 11acd96..576e4e1 100644 (file)
@@ -611,7 +611,7 @@ static const struct file_operations fops = {
 
 static struct drm_driver tilcdc_driver = {
        .driver_features    = (DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET |
-                              DRIVER_PRIME),
+                              DRIVER_PRIME | DRIVER_ATOMIC),
        .load               = tilcdc_load,
        .unload             = tilcdc_unload,
        .lastclose          = tilcdc_lastclose,