[openchrome-devel] drm-openchrome: Branch 'drm-next-5.11' - 2 commits - drivers/gpu/drm

Kevin Brace kevinbrace at kemper.freedesktop.org
Mon Nov 23 22:12:09 UTC 2020


 drivers/gpu/drm/openchrome/openchrome_analog.c  |    6 
 drivers/gpu/drm/openchrome/openchrome_crtc.c    |  414 +++++++++++-------------
 drivers/gpu/drm/openchrome/openchrome_cursor.c  |  202 +++++++----
 drivers/gpu/drm/openchrome/openchrome_display.c |    2 
 drivers/gpu/drm/openchrome/openchrome_drv.c     |    3 
 drivers/gpu/drm/openchrome/openchrome_drv.h     |    4 
 drivers/gpu/drm/openchrome/openchrome_fb.c      |    5 
 drivers/gpu/drm/openchrome/openchrome_fp.c      |    6 
 drivers/gpu/drm/openchrome/openchrome_hdmi.c    |    6 
 drivers/gpu/drm/openchrome/openchrome_pm.c      |   35 +-
 drivers/gpu/drm/openchrome/openchrome_sii164.c  |    6 
 drivers/gpu/drm/openchrome/openchrome_tmds.c    |    6 
 drivers/gpu/drm/openchrome/openchrome_vt1632.c  |    6 
 13 files changed, 414 insertions(+), 287 deletions(-)

New commits:
commit 713ce1ae6b192db912509b53401c33e64e21d947
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Nov 23 14:10:41 2020 -0800

    drm/openchrome: Version bumped to 3.4.4
    
    Finally, atomic mode setting is in!  It took a long time for this, but
    the code stability is now comparable to the existing "legacy" mode
    setting code.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 4c0981bd360b..1f2651788139 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -61,7 +61,7 @@
 
 #define DRIVER_MAJOR		3
 #define DRIVER_MINOR		4
-#define DRIVER_PATCHLEVEL	3
+#define DRIVER_PATCHLEVEL	4
 #define DRIVER_NAME		"openchrome"
 #define DRIVER_DESC		"OpenChrome DRM for VIA Technologies Chrome IGP"
 #define DRIVER_DATE		"20201123"
commit 8bf36d08a7662fb10290262de9d151df2bbaa97a
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Nov 23 14:08:56 2020 -0800

    drm/openchrome: Convert to atomic mode setting
    
    The conversion to atomic mode setting was done in a way to preserve
    the old "legacy" mode setting code as much as possible.  The changes
    between the two are fairly minimal considering the difference in
    semantics.  The suspend and resume code was borrowed from AST
    (ASpeed Technology) DRM, and applied to the existing power management
    code.  This code update was necessary for suspend and resume to work
    properly with atomic mode setting.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/drivers/gpu/drm/openchrome/openchrome_analog.c b/drivers/gpu/drm/openchrome/openchrome_analog.c
index cd6ce17d3008..f5e16382a0ed 100644
--- a/drivers/gpu/drm/openchrome/openchrome_analog.c
+++ b/drivers/gpu/drm/openchrome/openchrome_analog.c
@@ -24,6 +24,7 @@
  * James Simmons <jsimmons at infradead.org>
  */
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_probe_helper.h>
 
 #include "openchrome_crtc_hw.h"
@@ -280,6 +281,11 @@ static const struct drm_connector_funcs via_analog_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_connector_set_property,
 	.destroy = via_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 via_analog_get_modes(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/openchrome/openchrome_crtc.c b/drivers/gpu/drm/openchrome/openchrome_crtc.c
index dfdecc7af125..0ad8e1ef281c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_crtc.c
+++ b/drivers/gpu/drm/openchrome/openchrome_crtc.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Kevin Brace
+ * Copyright © 2019-2020 Kevin Brace
  * Copyright 2012 James Simmons <jsimmons at infradead.org>. All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person
@@ -33,6 +33,9 @@
 #include <linux/pci.h>
 #include <linux/pci_ids.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_fourcc.h>
@@ -324,9 +327,13 @@ static void openchrome_crtc_destroy(struct drm_crtc *crtc)
 }
 
 static const struct drm_crtc_funcs openchrome_drm_crtc_funcs = {
+	.reset = drm_atomic_helper_crtc_reset,
 	.gamma_set = openchrome_gamma_set,
-	.set_config = drm_crtc_helper_set_config,
+	.set_config = drm_atomic_helper_set_config,
 	.destroy = openchrome_crtc_destroy,
+	.page_flip = drm_atomic_helper_page_flip,
+	.atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+	.atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
 };
 
 static void via_load_vpit_regs(
@@ -1563,186 +1570,13 @@ via_set_iga2_downscale_source_timing(struct drm_crtc *crtc,
 	drm_mode_destroy(crtc->dev, src_timing);
 }
 
-static void openchrome_crtc_dpms(struct drm_crtc *crtc, int mode)
-{
-	struct openchrome_drm_private *dev_private =
-						crtc->dev->dev_private;
-	struct via_crtc *iga = container_of(crtc,
-						struct via_crtc, base);
-
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	if (!iga->index) {
-		switch (mode) {
-		case DRM_MODE_DPMS_SUSPEND:
-		case DRM_MODE_DPMS_STANDBY:
-		case DRM_MODE_DPMS_OFF:
-			/* turn off CRT screen (IGA1) */
-			svga_wseq_mask(VGABASE, 0x01, BIT(5), BIT(5));
-
-			/* clear for TV clock */
-			svga_wcrt_mask(VGABASE, 0x6C, 0x00, 0xF0);
-			break;
-
-		case DRM_MODE_DPMS_ON:
-			/* turn on CRT screen (IGA1) */
-			svga_wseq_mask(VGABASE, 0x01, 0x00, BIT(5));
-
-			/* disable simultaneous  */
-			svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
-			break;
-		}
-
-	} else {
-		switch (mode) {
-		case DRM_MODE_DPMS_SUSPEND:
-		case DRM_MODE_DPMS_STANDBY:
-		case DRM_MODE_DPMS_OFF:
-			/* turn off CRT screen (IGA2) */
-			svga_wcrt_mask(VGABASE, 0x6B, BIT(2), BIT(2));
-
-			/* clear for TV clock */
-			svga_wcrt_mask(VGABASE, 0x6C, 0x00, 0x0F);
-			break;
-
-		case DRM_MODE_DPMS_ON:
-			/* turn on CRT screen (IGA2) */
-			svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(2));
-
-			/* disable simultaneous  */
-			svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(3));
-			break;
-		}
-	}
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void openchrome_crtc_disable(struct drm_crtc *crtc)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	crtc->helper_private->dpms(crtc, DRM_MODE_DPMS_OFF);
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void openchrome_crtc_prepare(struct drm_crtc *crtc)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	/* Blank the screen */
-	if (crtc->enabled)
-		crtc->helper_private->dpms(crtc, DRM_MODE_DPMS_OFF);
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static void openchrome_crtc_commit(struct drm_crtc *crtc)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	/* Turn on the monitor */
-	if (crtc->enabled)
-		crtc->helper_private->dpms(crtc, DRM_MODE_DPMS_ON);
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-}
-
-static bool openchrome_crtc_mode_fixup(struct drm_crtc *crtc,
-				const struct drm_display_mode *mode,
-				struct drm_display_mode *adjusted_mode)
-{
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-	return true;
-}
-
-static int openchrome_crtc_mode_set_base(struct drm_crtc *crtc,
-					int x, int y,
-					struct drm_framebuffer *old_fb)
-{
-	struct drm_framebuffer *fb = crtc->primary->fb;
-	struct openchrome_bo *bo;
-	struct drm_gem_object *gem;
-	int ret = 0;
-	int fake_ret = 0;
-
-	DRM_DEBUG_KMS("Entered %s.\n", __func__);
-
-	/* No FB found. */
-	if (!fb) {
-		ret = -ENOMEM;
-		DRM_DEBUG_KMS("No FB found.\n");
-		goto exit;
-	}
-
-	gem = fb->obj[0];
-	bo = container_of(gem, struct openchrome_bo, gem);
-
-	ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
-	if (ret) {
-		DRM_DEBUG_KMS("Failed to reserve FB.\n");
-		goto exit;
-	}
-
-	ret = openchrome_bo_pin(bo, TTM_PL_VRAM);
-	ttm_bo_unreserve(&bo->ttm_bo);
-	if (ret) {
-		DRM_DEBUG_KMS("Failed to pin FB.\n");
-		goto exit;
-	}
-
-	ret = crtc->helper_private->mode_set_base_atomic(crtc,
-						fb, x, y,
-						ENTER_ATOMIC_MODE_SET);
-	if (unlikely(ret)) {
-		DRM_DEBUG_KMS("Failed to set a new FB.\n");
-		fake_ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
-		if (fake_ret) {
-			goto exit;
-		}
-
-		fake_ret = openchrome_bo_unpin(bo);
-		ttm_bo_unreserve(&bo->ttm_bo);
-		goto exit;
-	}
-
-	/*
-	 * Free the old framebuffer if it exists.
-	 */
-	if (old_fb) {
-		gem = old_fb->obj[0];
-		bo = container_of(gem, struct openchrome_bo, gem);
-
-		ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
-		if (ret) {
-			DRM_DEBUG_KMS("FB still locked.\n");
-			goto exit;
-		}
-
-		ret = openchrome_bo_unpin(bo);
-		ttm_bo_unreserve(&bo->ttm_bo);
-		if (ret) {
-			DRM_DEBUG_KMS("FB still locked.\n");
-			goto exit;
-		}
-	}
-
-exit:
-	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-	return ret;
-}
-
-static int openchrome_crtc_mode_set(struct drm_crtc *crtc,
-				struct drm_display_mode *mode,
-				struct drm_display_mode *adjusted_mode,
-				int x, int y,
-				struct drm_framebuffer *fb)
+void openchrome_mode_set_nofb(struct drm_crtc *crtc)
 {
 	struct via_crtc *iga = container_of(crtc,
 						struct via_crtc, base);
+	struct drm_display_mode *mode = &crtc->mode;
+	struct drm_display_mode *adjusted_mode =
+					&crtc->state->adjusted_mode;
 	struct openchrome_drm_private *dev_private =
 						crtc->dev->dev_private;
 	struct drm_device *dev = crtc->dev;
@@ -1818,6 +1652,11 @@ static int openchrome_crtc_mode_set(struct drm_crtc *crtc,
 			pll_regs = via_get_clk_value(crtc->dev, clock);
 			via_set_vclock(crtc, pll_regs);
 		}
+
+		via_iga_common_init(VGABASE);
+
+		/* Set palette LUT to 8-bit mode. */
+		via_iga1_set_palette_lut_resolution(VGABASE, true);
 	} else {
 		/* Load standard registers */
 		via_load_vpit_regs(dev_private);
@@ -1932,34 +1771,134 @@ static int openchrome_crtc_mode_set(struct drm_crtc *crtc,
 			pll_regs = via_get_clk_value(crtc->dev, clock);
 			via_set_vclock(crtc, pll_regs);
 		}
+
+		via_iga_common_init(VGABASE);
+
+		/* Set palette LUT to 8-bit mode. */
+		via_iga2_set_palette_lut_resolution(VGABASE, true);
+
+		enable_second_display_channel(VGABASE);
 	}
 
-	ret = openchrome_crtc_mode_set_base(crtc, x, y, fb);
+exit:
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+static void openchrome_crtc_helper_atomic_enable(struct drm_crtc *crtc,
+					struct drm_crtc_state *old_crtc_state)
+{
+	struct openchrome_drm_private *dev_private =
+						crtc->dev->dev_private;
+	struct via_crtc *iga = container_of(crtc,
+						struct via_crtc, base);
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if (!iga->index) {
+		svga_wseq_mask(VGABASE, 0x01, 0x00, BIT(5));
+	} else {
+		svga_wcrt_mask(VGABASE, 0x6B, 0x00, BIT(2));
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+static void openchrome_crtc_helper_atomic_disable(struct drm_crtc *crtc,
+					struct drm_crtc_state *old_crtc_state)
+{
+	struct openchrome_drm_private *dev_private =
+						crtc->dev->dev_private;
+	struct via_crtc *iga = container_of(crtc,
+						struct via_crtc, base);
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if (!iga->index) {
+		svga_wseq_mask(VGABASE, 0x01, BIT(5), BIT(5));
+	} else {
+		svga_wcrt_mask(VGABASE, 0x6B, BIT(2), BIT(2));
+	}
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+static const struct
+drm_crtc_helper_funcs openchrome_drm_crtc_helper_funcs = {
+	.mode_set_nofb = openchrome_mode_set_nofb,
+	.atomic_enable = openchrome_crtc_helper_atomic_enable,
+	.atomic_disable = openchrome_crtc_helper_atomic_disable,
+};
+
+static int openchrome_primary_atomic_check(struct drm_plane *plane,
+					struct drm_plane_state *state)
+{
+	struct drm_device *dev = plane->dev;
+	struct drm_framebuffer *fb = state->fb;
+	struct drm_crtc_state *crtc_state;
+	struct openchrome_drm_private *dev_private =
+					plane->dev->dev_private;
+	uint32_t frame_buffer_size;
+	int ret = 0;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if ((!state->crtc) || (!state->visible)) {
+		goto exit;
+	}
+
+	frame_buffer_size = (fb->width * fb->format->cpp[0]) *
+				fb->height;
+	if (frame_buffer_size > dev_private->vram_size) {
+		ret = -ENOMEM;
+		goto exit;
+	}
+
+	if ((fb->width > dev->mode_config.max_width) ||
+		(fb->width < dev->mode_config.min_width)) {
+		ret = -EINVAL;
+		goto exit;
+	}
+
+	crtc_state = drm_atomic_get_new_crtc_state(state->state,
+							state->crtc);
+	ret = drm_atomic_helper_check_plane_state(state, crtc_state,
+						DRM_PLANE_HELPER_NO_SCALING,
+						DRM_PLANE_HELPER_NO_SCALING,
+						false, true);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
 
-static int openchrome_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
-					struct drm_framebuffer *fb,
-					int x, int y,
-					enum mode_set_atomic state)
+static void openchrome_primary_atomic_disable(struct drm_plane *plane,
+				struct drm_plane_state *old_state)
+{
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	return;
+}
+
+void openchrome_primary_atomic_update(struct drm_plane *plane,
+				struct drm_plane_state *old_state)
 {
-	u32 pitch = y * fb->pitches[0] +
-			((x * fb->format->cpp[0] * 8) >> 3), addr;
+	struct drm_plane_state *state = plane->state;
+	struct drm_crtc *crtc = state->crtc;
+	struct drm_framebuffer *fb = state->fb;
+	uint32_t pitch = (state->crtc_y * fb->pitches[0]) +
+			(state->crtc_x * ((fb->format->cpp[0] * 8) >> 3));
+	uint32_t addr;
 	struct via_crtc *iga = container_of(crtc, struct via_crtc, base);
 	struct openchrome_drm_private *dev_private =
 						crtc->dev->dev_private;
 	struct drm_gem_object *gem = fb->obj[0];
 	struct openchrome_bo *bo = container_of(gem,
 					struct openchrome_bo, gem);
-	int ret = 0;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	if ((fb->format->depth != 8) && (fb->format->depth != 16) &&
 		(fb->format->depth != 24)) {
-		ret = -EINVAL;
 		DRM_ERROR("Unsupported IGA%s Color Depth: %d bit\n",
 					(!iga->index) ? "1" : "2",
 					fb->format->depth);
@@ -1967,11 +1906,6 @@ static int openchrome_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
 	}
 
 	if (!iga->index) {
-		via_iga_common_init(VGABASE);
-
-		/* Set palette LUT to 8-bit mode. */
-		via_iga1_set_palette_lut_resolution(VGABASE, true);
-
 		via_iga1_set_color_depth(dev_private, fb->format->depth);
 
 		/* Set the framebuffer offset */
@@ -1994,11 +1928,6 @@ static int openchrome_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
 		 * second adapter */
 		load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
 	} else {
-		via_iga_common_init(VGABASE);
-
-		/* Set palette LUT to 8-bit mode. */
-		via_iga2_set_palette_lut_resolution(VGABASE, true);
-
 		via_iga2_set_color_depth(dev_private, fb->format->depth);
 
 		/* Set the framebuffer offset */
@@ -2019,27 +1948,86 @@ static int openchrome_crtc_mode_set_base_atomic(struct drm_crtc *crtc,
 		/* Set secondary pitch */
 		pitch = ALIGN(fb->pitches[0], 16);
 		load_value_to_registers(VGABASE, &iga->offset, pitch >> 3);
+	}
 
-		enable_second_display_channel(VGABASE);
+exit:
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+static int openchrome_primary_prepare_fb(struct drm_plane *plane,
+				struct drm_plane_state *new_state)
+{
+	struct openchrome_bo *bo;
+	struct drm_gem_object *gem;
+	int ret = 0;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if (!new_state->fb) {
+		goto exit;
+	}
+
+	gem = new_state->fb->obj[0];
+	bo = container_of(gem, struct openchrome_bo, gem);
+
+	ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
+	if (ret) {
+		goto exit;
 	}
 
+	ret = openchrome_bo_pin(bo, TTM_PL_VRAM);
+	ttm_bo_unreserve(&bo->ttm_bo);
 exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
 
-static const struct
-drm_crtc_helper_funcs openchrome_drm_crtc_helper_funcs = {
-	.dpms = openchrome_crtc_dpms,
-	.disable = openchrome_crtc_disable,
-	.prepare = openchrome_crtc_prepare,
-	.commit = openchrome_crtc_commit,
-	.mode_fixup = openchrome_crtc_mode_fixup,
-	.mode_set = openchrome_crtc_mode_set,
-	.mode_set_base_atomic = openchrome_crtc_mode_set_base_atomic,
-};
+static void openchrome_primary_cleanup_fb(struct drm_plane *plane,
+				struct drm_plane_state *old_state)
+{
+	struct openchrome_bo *bo;
+	struct drm_gem_object *gem;
+	int ret;
 
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
+	if (!old_state->fb) {
+		goto exit;
+	}
+
+	gem = old_state->fb->obj[0];
+	bo = container_of(gem, struct openchrome_bo, gem);
+
+	ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
+	if (ret) {
+		goto exit;
+	}
+
+	ret = openchrome_bo_unpin(bo);
+	ttm_bo_unreserve(&bo->ttm_bo);
+exit:
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+static const struct drm_plane_helper_funcs
+openchrome_primary_drm_plane_helper_funcs = {
+	.prepare_fb = openchrome_primary_prepare_fb,
+	.cleanup_fb = openchrome_primary_cleanup_fb,
+	.atomic_check = openchrome_primary_atomic_check,
+	.atomic_update = openchrome_primary_atomic_update,
+	.atomic_disable = openchrome_primary_atomic_disable,
+};
+
+static const struct drm_plane_funcs openchrome_primary_drm_plane_funcs = {
+	.update_plane	= drm_atomic_helper_update_plane,
+	.disable_plane = drm_atomic_helper_disable_plane,
+	.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 void openchrome_crtc_param_init(
 		struct openchrome_drm_private *dev_private,
@@ -2212,8 +2200,6 @@ static void openchrome_crtc_param_init(
 	}
 }
 
-
-
 static const uint32_t openchrome_primary_formats[] = {
 	DRM_FORMAT_XRGB8888,
 	DRM_FORMAT_ARGB8888,
@@ -2241,8 +2227,10 @@ int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
 		goto exit;
 	}
 
+	drm_plane_helper_add(primary,
+			&openchrome_primary_drm_plane_helper_funcs);
 	ret = drm_universal_plane_init(dev, primary, possible_crtcs,
-			&drm_primary_helper_funcs,
+			&openchrome_primary_drm_plane_funcs,
 			openchrome_primary_formats,
 			ARRAY_SIZE(openchrome_primary_formats),
 			NULL, DRM_PLANE_TYPE_PRIMARY, NULL);
@@ -2259,6 +2247,8 @@ int openchrome_crtc_init(struct openchrome_drm_private *dev_private,
 		goto cleanup_primary;
 	}
 
+	drm_plane_helper_add(cursor,
+			&openchrome_cursor_drm_plane_helper_funcs);
 	ret = drm_universal_plane_init(dev, cursor, possible_crtcs,
 			&openchrome_cursor_drm_plane_funcs,
 			openchrome_cursor_formats,
diff --git a/drivers/gpu/drm/openchrome/openchrome_cursor.c b/drivers/gpu/drm/openchrome/openchrome_cursor.c
index 8bef134ad236..f44b16aa85f8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_cursor.c
+++ b/drivers/gpu/drm/openchrome/openchrome_cursor.c
@@ -1,5 +1,5 @@
 /*
- * Copyright © 2019 Kevin Brace
+ * Copyright © 2019-2020 Kevin Brace
  * Copyright 2012 James Simmons <jsimmons at infradead.org>. All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person
@@ -32,6 +32,9 @@
 
 #include <linux/pci_ids.h>
 
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_fourcc.h>
 #include <drm/drm_framebuffer.h>
@@ -51,7 +54,8 @@ static void openchrome_hide_cursor(struct drm_device *dev,
 {
 	struct via_crtc *iga = container_of(crtc,
 					struct via_crtc, base);
-	struct openchrome_drm_private *dev_private = dev->dev_private;
+	struct openchrome_drm_private *dev_private =
+					dev->dev_private;
 	uint32_t temp;
 
 	switch (dev->pdev->device) {
@@ -92,8 +96,10 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
 	case PCI_DEVICE_ID_VIA_VT1122:
 	case PCI_DEVICE_ID_VIA_VX875:
 	case PCI_DEVICE_ID_VIA_VX900_VGA:
-		/* Program Hardware Icon (HI) FIFO, foreground, and
-		 * background colors. */
+		/*
+		 * Program Hardware Icon (HI) FIFO, foreground color,
+		 * and background color.
+		 */
 		if (iga->index) {
 			VIA_WRITE(HI_TRANSPARENT_COLOR, 0x00000000);
 			VIA_WRITE(HI_INVTCOLOR, 0x00FFFFFF);
@@ -109,6 +115,10 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
 
 		break;
 	default:
+		/*
+		 * Program Hardware Icon (HI) FIFO, foreground color,
+		 * and background color.
+		 */
 		VIA_WRITE(HI_TRANSPARENT_COLOR, 0x00000000);
 		VIA_WRITE(HI_INVTCOLOR, 0x00FFFFFF);
 		VIA_WRITE(ALPHA_V3_PREFIFO_CONTROL, 0x000E0000);
@@ -123,7 +133,9 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
 	case PCI_DEVICE_ID_VIA_VT1122:
 	case PCI_DEVICE_ID_VIA_VX875:
 	case PCI_DEVICE_ID_VIA_VX900_VGA:
-		/* Turn on Hardware icon Cursor */
+		/*
+		 * Turn on Hardware Icon (HI).
+		 */
 		if (iga->index) {
 			VIA_WRITE(HI_CONTROL, 0xB6000005);
 		} else {
@@ -132,6 +144,9 @@ static void openchrome_show_cursor(struct drm_crtc *crtc)
 
 		break;
 	default:
+		/*
+		 * Turn on Hardware Icon (HI).
+		 */
 		if (iga->index) {
 			VIA_WRITE(HI_CONTROL, 0xB6000005);
 		} else {
@@ -150,14 +165,6 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
 					struct via_crtc, base);
 	struct openchrome_drm_private *dev_private =
 					crtc->dev->dev_private;
-	int ret;
-
-	ret = ttm_bo_kmap(&ttm_bo->ttm_bo, 0,
-				ttm_bo->ttm_bo.num_pages,
-				&ttm_bo->kmap);
-	if (ret) {
-		goto exit;
-	}
 
 	switch (dev->pdev->device) {
 	case PCI_DEVICE_ID_VIA_VT3157:
@@ -166,7 +173,9 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
 	case PCI_DEVICE_ID_VIA_VT1122:
 	case PCI_DEVICE_ID_VIA_VX875:
 	case PCI_DEVICE_ID_VIA_VX900_VGA:
-		/* Program the HI offset. */
+		/*
+		 * Program Hardware Icon (HI) offset.
+		 */
 		if (iga->index) {
 			VIA_WRITE(HI_FBOFFSET,
 			ttm_bo->kmap.bo->mem.start << PAGE_SHIFT);
@@ -176,13 +185,14 @@ static void openchrome_cursor_address(struct drm_crtc *crtc,
 		}
 		break;
 	default:
+		/*
+		 * Program Hardware Icon (HI) offset.
+		 */
 		VIA_WRITE(HI_FBOFFSET,
 			ttm_bo->kmap.bo->mem.start << PAGE_SHIFT);
 		break;
 	}
 
-	ttm_bo_kunmap(&ttm_bo->kmap);
-exit:
 	return;
 }
 
@@ -245,42 +255,80 @@ static void openchrome_set_hi_location(struct drm_crtc *crtc,
 	}
 }
 
-static int openchrome_cursor_update_plane(struct drm_plane *plane,
-				struct drm_crtc *crtc,
-				struct drm_framebuffer *fb,
-				int crtc_x, int crtc_y,
-				unsigned int crtc_w,
-				unsigned int crtc_h,
-				uint32_t src_x, uint32_t src_y,
-				uint32_t src_w, uint32_t src_h,
-				struct drm_modeset_acquire_ctx *ctx)
+static int openchrome_cursor_prepare_fb(struct drm_plane *plane,
+				struct drm_plane_state *new_state)
 {
-	struct openchrome_bo *ttm_bo;
 	struct drm_gem_object *gem;
+	struct openchrome_bo *bo;
 	int ret = 0;
 
-	if (!crtc) {
-		DRM_ERROR("Invalid CRTC!\n");
-		ret = -EINVAL;
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if (!new_state->fb) {
 		goto exit;
 	}
 
-	if (!crtc->enabled) {
-		DRM_ERROR("CRTC is currently disabled!\n");
-		ret = -EINVAL;
+	gem = new_state->fb->obj[0];
+	bo = container_of(gem, struct openchrome_bo, gem);
+
+	ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
+	if (ret) {
 		goto exit;
 	}
 
-	if (!fb) {
-		DRM_ERROR("Invalid frame buffer!\n");
-		ret = -EINVAL;
+	ret = openchrome_bo_pin(bo, TTM_PL_VRAM);
+	ttm_bo_unreserve(&bo->ttm_bo);
+	ret = ttm_bo_kmap(&bo->ttm_bo, 0,
+				bo->ttm_bo.num_pages,
+				&bo->kmap);
+	if (ret) {
 		goto exit;
 	}
 
-	if ((fb->width != OPENCHROME_CURSOR_SIZE) ||
-		(fb->height != OPENCHROME_CURSOR_SIZE)) {
-		DRM_ERROR("Invalid cursor dimensions.\n");
-		ret = -EINVAL;
+exit:
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+	return ret;
+}
+
+static void openchrome_cursor_cleanup_fb(struct drm_plane *plane,
+				struct drm_plane_state *old_state)
+{
+	struct drm_gem_object *gem;
+	struct openchrome_bo *bo;
+	int ret;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if (!old_state->fb) {
+		goto exit;
+	}
+
+	gem = old_state->fb->obj[0];
+	bo = container_of(gem, struct openchrome_bo, gem);
+
+	ttm_bo_kunmap(&bo->kmap);
+	ret = ttm_bo_reserve(&bo->ttm_bo, true, false, NULL);
+	if (ret) {
+		goto exit;
+	}
+
+	ret = openchrome_bo_unpin(bo);
+	ttm_bo_unreserve(&bo->ttm_bo);
+
+exit:
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
+}
+
+static int openchrome_cursor_atomic_check(struct drm_plane *plane,
+					struct drm_plane_state *state)
+{
+	struct drm_framebuffer *fb = state->fb;
+	struct drm_crtc_state *crtc_state;
+	int ret = 0;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	if ((!state->crtc) || (!state->visible)) {
 		goto exit;
 	}
 
@@ -291,46 +339,70 @@ static int openchrome_cursor_update_plane(struct drm_plane *plane,
 		goto exit;
 	}
 
-	if (fb != crtc->cursor->fb) {
-		gem = fb->obj[0];
-		ttm_bo = container_of(gem, struct openchrome_bo, gem);
-		openchrome_cursor_address(crtc, ttm_bo);
-	} else {
-		crtc->cursor_x = crtc_x;
-		crtc->cursor_y = crtc_y;
-		openchrome_set_hi_location(crtc, crtc_x, crtc_y);
-	}
-
-	openchrome_show_cursor(crtc);
+	crtc_state = drm_atomic_get_new_crtc_state(state->state,
+							state->crtc);
+	ret = drm_atomic_helper_check_plane_state(state, crtc_state,
+					DRM_PLANE_HELPER_NO_SCALING,
+					DRM_PLANE_HELPER_NO_SCALING,
+					true, true);
 exit:
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 	return ret;
 }
 
-static int openchrome_cursor_disable_plane(struct drm_plane *plane,
-				struct drm_modeset_acquire_ctx *ctx)
+static void openchrome_cursor_atomic_update(struct drm_plane *plane,
+				struct drm_plane_state *old_state)
 {
-	if (plane->crtc) {
-		openchrome_hide_cursor(plane->dev, plane->crtc);
-	}
+	struct drm_plane_state *state = plane->state;
+	struct drm_crtc *crtc = plane->state->crtc;
+	struct openchrome_bo *bo;
+	struct drm_gem_object *gem;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
-	if (plane->fb) {
-		drm_framebuffer_put(plane->fb);
-		plane->fb = NULL;
+	if (state->fb != old_state->fb) {
+		gem = state->fb->obj[0];
+		bo = container_of(gem, struct openchrome_bo, gem);
+		openchrome_cursor_address(crtc, bo);
 	}
 
-	return 0;
+	openchrome_set_hi_location(crtc,
+				state->crtc_x,
+				state->crtc_y);
+	openchrome_show_cursor(crtc);
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
-static void openchrome_cursor_destroy(struct drm_plane *plane)
+void openchrome_cursor_atomic_disable(struct drm_plane *plane,
+			struct drm_plane_state *old_state)
 {
-	drm_plane_cleanup(plane);
-	kfree(plane);
+	struct drm_device *dev = plane->dev;
+	struct drm_crtc *crtc = plane->state->crtc;
+
+	DRM_DEBUG_KMS("Entered %s.\n", __func__);
+
+	openchrome_hide_cursor(dev, crtc);
+
+	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
 }
 
+const struct drm_plane_helper_funcs
+openchrome_cursor_drm_plane_helper_funcs = {
+	.prepare_fb	= openchrome_cursor_prepare_fb,
+	.cleanup_fb	= openchrome_cursor_cleanup_fb,
+	.atomic_check	= openchrome_cursor_atomic_check,
+	.atomic_update	= openchrome_cursor_atomic_update,
+	.atomic_disable	= openchrome_cursor_atomic_disable,
+};
+
 const struct drm_plane_funcs openchrome_cursor_drm_plane_funcs = {
-	.update_plane	= openchrome_cursor_update_plane,
-	.disable_plane	= openchrome_cursor_disable_plane,
-	.destroy	= openchrome_cursor_destroy,
+	.update_plane = drm_atomic_helper_update_plane,
+	.disable_plane = drm_atomic_helper_disable_plane,
+	.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,
 };
 
 const uint32_t openchrome_cursor_formats[] = {
diff --git a/drivers/gpu/drm/openchrome/openchrome_display.c b/drivers/gpu/drm/openchrome/openchrome_display.c
index a7ebc4926a4b..89f835c664c9 100644
--- a/drivers/gpu/drm/openchrome/openchrome_display.c
+++ b/drivers/gpu/drm/openchrome/openchrome_display.c
@@ -510,6 +510,8 @@ via_modeset_init(struct drm_device *dev)
 		break;
 	}
 
+	drm_mode_config_reset(dev);
+
 	/* Initialize the frame buffer device. */
 	ret = openchrome_fb_init(dev);
 	if (ret) {
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.c b/drivers/gpu/drm/openchrome/openchrome_drv.c
index 86bb3cdd120f..3173a576ac5e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.c
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.c
@@ -184,7 +184,8 @@ static const struct file_operations via_driver_fops = {
 static struct drm_driver openchrome_driver = {
 	.driver_features = DRIVER_HAVE_IRQ |
 				DRIVER_GEM |
-				DRIVER_MODESET,
+				DRIVER_MODESET |
+				DRIVER_ATOMIC,
 	.open = openchrome_drm_driver_open,
 	.postclose = openchrome_drm_driver_postclose,
 	.lastclose = openchrome_drm_driver_lastclose,
diff --git a/drivers/gpu/drm/openchrome/openchrome_drv.h b/drivers/gpu/drm/openchrome/openchrome_drv.h
index 4216d51bfeed..4c0981bd360b 100644
--- a/drivers/gpu/drm/openchrome/openchrome_drv.h
+++ b/drivers/gpu/drm/openchrome/openchrome_drv.h
@@ -421,6 +421,8 @@ void openchrome_transmitter_display_source(
 			struct openchrome_drm_private *dev_private,
 			u32 di_port, int index);
 
+extern const struct drm_plane_helper_funcs
+openchrome_cursor_drm_plane_helper_funcs;
 extern const struct drm_plane_funcs openchrome_cursor_drm_plane_funcs;
 extern const uint32_t openchrome_cursor_formats[];
 extern const unsigned int openchrome_cursor_formats_size;
diff --git a/drivers/gpu/drm/openchrome/openchrome_fb.c b/drivers/gpu/drm/openchrome/openchrome_fb.c
index 17f2ed04a249..a9fd14a4c345 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fb.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fb.c
@@ -23,6 +23,7 @@
 
 #include <linux/fb.h>
 
+#include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_fb_helper.h>
@@ -101,7 +102,8 @@ openchrome_fb_create(struct drm_device *dev,
 
 static const struct drm_mode_config_funcs openchrome_drm_mode_config_funcs = {
 	.fb_create		= openchrome_fb_create,
-	.output_poll_changed	= drm_fb_helper_output_poll_changed
+	.atomic_check		= drm_atomic_helper_check,
+	.atomic_commit		= drm_atomic_helper_commit,
 };
 
 void openchrome_mode_config_init(
@@ -264,7 +266,6 @@ int openchrome_fb_init(struct drm_device *dev)
 		goto free_fbdev;
 	}
 
-	drm_helper_disable_unused_functions(dev);
 	ret = drm_fb_helper_initial_config(&openchrome_fb->helper, bpp_sel);
 	if (ret) {
 		goto free_fb_helper;
diff --git a/drivers/gpu/drm/openchrome/openchrome_fp.c b/drivers/gpu/drm/openchrome/openchrome_fp.c
index 1810b4a539d3..47ebf87fcc3d 100644
--- a/drivers/gpu/drm/openchrome/openchrome_fp.c
+++ b/drivers/gpu/drm/openchrome/openchrome_fp.c
@@ -28,6 +28,7 @@
 
 #include <asm/olpc.h>
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_probe_helper.h>
 
 #include "openchrome_drv.h"
@@ -920,6 +921,11 @@ struct drm_connector_funcs via_fp_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_fp_set_property,
 	.destroy = via_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
diff --git a/drivers/gpu/drm/openchrome/openchrome_hdmi.c b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
index bccaa17f73e6..a95f0170188c 100644
--- a/drivers/gpu/drm/openchrome/openchrome_hdmi.c
+++ b/drivers/gpu/drm/openchrome/openchrome_hdmi.c
@@ -26,6 +26,7 @@
 
 #include <linux/delay.h>
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_drv.h>
 #include <drm/drm_print.h>
 #include <drm/drm_probe_helper.h>
@@ -627,6 +628,11 @@ static const struct drm_connector_funcs via_hdmi_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_hdmi_set_property,
 	.destroy = via_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
diff --git a/drivers/gpu/drm/openchrome/openchrome_pm.c b/drivers/gpu/drm/openchrome/openchrome_pm.c
index 335779e94bab..47c7eb2119e1 100644
--- a/drivers/gpu/drm/openchrome/openchrome_pm.c
+++ b/drivers/gpu/drm/openchrome/openchrome_pm.c
@@ -39,12 +39,11 @@ int openchrome_dev_pm_ops_suspend(struct device *dev)
 	struct pci_dev *pdev = to_pci_dev(dev);
 	struct drm_device *drm_dev = pci_get_drvdata(pdev);
 	struct openchrome_drm_private *dev_private = drm_dev->dev_private;
+	int ret = 0;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
 	console_lock();
-	drm_fb_helper_set_suspend(&dev_private->openchrome_fb->helper,
-					true);
 
 	/*
 	 * Frame Buffer Size Control register (SR14) and GTI registers
@@ -84,8 +83,18 @@ int openchrome_dev_pm_ops_suspend(struct device *dev)
 
 	console_unlock();
 
+	ret = drm_mode_config_helper_suspend(drm_dev);
+	if (ret) {
+		DRM_ERROR("Failed to prepare for suspend.\n");
+		goto exit;
+	}
+
+	pci_save_state(pdev);
+	pci_disable_device(pdev);
+	pci_set_power_state(pdev, PCI_D3hot);
+exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-	return 0;
+	return ret;
 }
 
 int openchrome_dev_pm_ops_resume(struct device *dev)
@@ -96,9 +105,17 @@ int openchrome_dev_pm_ops_resume(struct device *dev)
 						drm_dev->dev_private;
 	void __iomem *regs = ioport_map(0x3c0, 100);
 	u8 val;
+	int ret = 0;
 
 	DRM_DEBUG_KMS("Entered %s.\n", __func__);
 
+	if (pci_enable_device(pdev)) {
+		DRM_ERROR("Failed to initialize a PCI "
+				"after resume.\n");
+		ret = -EIO;
+		goto exit;
+	}
+
 	console_lock();
 
 	val = ioread8(regs + 0x03);
@@ -160,10 +177,16 @@ int openchrome_dev_pm_ops_resume(struct device *dev)
 	vga_wcrt(VGABASE, 0x3e, dev_private->saved_cr3e);
 	vga_wcrt(VGABASE, 0x3f, dev_private->saved_cr3f);
 
-	drm_helper_resume_force_mode(drm_dev);
-	drm_fb_helper_set_suspend(&dev_private->openchrome_fb->helper, false);
 	console_unlock();
 
+	ret = drm_mode_config_helper_resume(drm_dev);
+	if (ret) {
+		DRM_ERROR("Failed to perform a modeset "
+				"after resume.\n");
+		goto exit;
+	}
+
+exit:
 	DRM_DEBUG_KMS("Exiting %s.\n", __func__);
-	return 0;
+	return ret;
 }
diff --git a/drivers/gpu/drm/openchrome/openchrome_sii164.c b/drivers/gpu/drm/openchrome/openchrome_sii164.c
index a52d4101702a..aee0f9bd0e5e 100644
--- a/drivers/gpu/drm/openchrome/openchrome_sii164.c
+++ b/drivers/gpu/drm/openchrome/openchrome_sii164.c
@@ -27,6 +27,7 @@
  *
  */
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_probe_helper.h>
 
 #include "openchrome_drv.h"
@@ -385,6 +386,11 @@ static const struct drm_connector_funcs openchrome_sii164_drm_connector_funcs =
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_connector_set_property,
 	.destroy = via_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,
 };
 
 
diff --git a/drivers/gpu/drm/openchrome/openchrome_tmds.c b/drivers/gpu/drm/openchrome/openchrome_tmds.c
index 16f0537e6d18..920b167762b8 100644
--- a/drivers/gpu/drm/openchrome/openchrome_tmds.c
+++ b/drivers/gpu/drm/openchrome/openchrome_tmds.c
@@ -26,6 +26,7 @@
  *	James Simmons <jsimmons at infradead.org>
  */
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_probe_helper.h>
 
 #include "openchrome_drv.h"
@@ -357,6 +358,11 @@ static const struct drm_connector_funcs via_dvi_connector_funcs = {
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_connector_set_property,
 	.destroy = via_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 via_tmds_get_modes(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/openchrome/openchrome_vt1632.c b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
index fb4ef2fce000..f7c9a7eb7ba0 100644
--- a/drivers/gpu/drm/openchrome/openchrome_vt1632.c
+++ b/drivers/gpu/drm/openchrome/openchrome_vt1632.c
@@ -27,6 +27,7 @@
  *
  */
 
+#include <drm/drm_atomic_state_helper.h>
 #include <drm/drm_probe_helper.h>
 
 #include "openchrome_drv.h"
@@ -405,6 +406,11 @@ static const struct drm_connector_funcs openchrome_vt1632_drm_connector_funcs =
 	.fill_modes = drm_helper_probe_single_connector_modes,
 	.set_property = via_connector_set_property,
 	.destroy = via_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,
 };
 
 


More information about the openchrome-devel mailing list