dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, Hans de Goede <hdegoede@redhat.com>,
	Michael Thayer <michael.thayer@oracle.com>,
	dri-devel@lists.freedesktop.org
Subject: [PATCH resend 07/15] staging: vboxvideo: Atomic phase 2: Wire up state object handlers
Date: Sat, 29 Sep 2018 14:18:17 +0200	[thread overview]
Message-ID: <20180929121825.25765-8-hdegoede@redhat.com> (raw)
In-Reply-To: <20180929121825.25765-1-hdegoede@redhat.com>

Wire up state object handlers for the crtc-s and the planes, call
drm_mode_config_reset() after creating all the crtc-s and encoders and
remove the legacy drm_helper_disable_unused_functions() call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/staging/vboxvideo/vbox_fb.c   |  3 ---
 drivers/staging/vboxvideo/vbox_mode.c | 15 ++++++++++-----
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/vboxvideo/vbox_fb.c b/drivers/staging/vboxvideo/vbox_fb.c
index b8b42f9aafae..8a9d56762659 100644
--- a/drivers/staging/vboxvideo/vbox_fb.c
+++ b/drivers/staging/vboxvideo/vbox_fb.c
@@ -216,9 +216,6 @@ int vbox_fbdev_init(struct vbox_private *vbox)
 	if (ret)
 		goto err_fini;
 
-	/* disable all the possible outputs/crtcs before entering KMS mode */
-	drm_helper_disable_unused_functions(dev);
-
 	ret = drm_fb_helper_initial_config(&fbdev->helper, 32);
 	if (ret)
 		goto err_fini;
diff --git a/drivers/staging/vboxvideo/vbox_mode.c b/drivers/staging/vboxvideo/vbox_mode.c
index e560e36e7953..cb897b672752 100644
--- a/drivers/staging/vboxvideo/vbox_mode.c
+++ b/drivers/staging/vboxvideo/vbox_mode.c
@@ -301,10 +301,6 @@ static const struct drm_crtc_helper_funcs vbox_crtc_helper_funcs = {
 	.atomic_flush = vbox_crtc_atomic_flush,
 };
 
-static void vbox_crtc_reset(struct drm_crtc *crtc)
-{
-}
-
 static void vbox_crtc_destroy(struct drm_crtc *crtc)
 {
 	drm_crtc_cleanup(crtc);
@@ -312,10 +308,12 @@ static void vbox_crtc_destroy(struct drm_crtc *crtc)
 }
 
 static const struct drm_crtc_funcs vbox_crtc_funcs = {
-	.reset = vbox_crtc_reset,
 	.set_config = drm_crtc_helper_set_config,
 	/* .gamma_set = vbox_crtc_gamma_set, */
 	.destroy = vbox_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 int vbox_primary_atomic_check(struct drm_plane *plane,
@@ -527,6 +525,9 @@ static const struct drm_plane_funcs vbox_cursor_plane_funcs = {
 	.update_plane	= drm_plane_helper_update,
 	.disable_plane	= drm_plane_helper_disable,
 	.destroy	= drm_primary_helper_destroy,
+	.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 uint32_t vbox_primary_plane_formats[] = {
@@ -546,6 +547,9 @@ static const struct drm_plane_funcs vbox_primary_plane_funcs = {
 	.update_plane	= drm_plane_helper_update,
 	.disable_plane	= drm_primary_helper_disable,
 	.destroy	= drm_primary_helper_destroy,
+	.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 struct drm_plane *vbox_create_plane(struct vbox_private *vbox,
@@ -982,6 +986,7 @@ int vbox_mode_init(struct vbox_private *vbox)
 			goto err_drm_mode_cleanup;
 	}
 
+	drm_mode_config_reset(dev);
 	return 0;
 
 err_drm_mode_cleanup:
-- 
2.19.0

  parent reply	other threads:[~2018-09-29 12:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29 12:18 [PATCH resend 00/15] staging: vboxvideo: Convert to atomic modesetting API Hans de Goede
2018-09-29 12:18 ` [PATCH resend 01/15] staging: vboxvideo: Cleanup vbox_set_up_input_mapping() Hans de Goede
2018-09-29 12:18 ` [PATCH resend 02/15] staging: vboxvideo: Remove empty encoder_helper_funcs Hans de Goede
2018-09-29 12:18 ` [PATCH resend 03/15] staging: vboxvideo: Temporarily remove page_flip support Hans de Goede
2018-09-29 12:18 ` [PATCH resend 04/15] staging: vboxvideo: Cache mode width, height and crtc panning in vbox_crtc Hans de Goede
2018-09-29 12:18 ` [PATCH resend 05/15] staging: vboxvideo: Atomic phase 1: convert cursor to universal plane Hans de Goede
2018-09-29 12:18 ` [PATCH resend 06/15] staging: vboxvideo: Atomic phase 1: Use drm_plane_helpers for primary plane Hans de Goede
2018-09-29 12:18 ` Hans de Goede [this message]
2018-09-29 12:18 ` [PATCH resend 08/15] staging: vboxvideo: Atomic phase 2: Stop using plane->fb and crtc->* Hans de Goede
2018-09-29 12:18 ` [PATCH resend 09/15] staging: vboxvideo: Atomic phase 3: Switch last bits over to atomic Hans de Goede
2018-09-29 12:18 ` [PATCH resend 10/15] staging: vboxvideo: Restore page-flip support Hans de Goede
2018-09-29 12:18 ` [PATCH resend 11/15] staging: vboxvideo: Fix DPMS support after atomic conversion Hans de Goede
2018-09-29 12:18 ` [PATCH resend 12/15] staging: vboxvideo: Replace crtc_helper enable/disable functions Hans de Goede
2018-09-29 12:18 ` [PATCH resend 13/15] staging: vboxvideo: Call drm_atomic_helper_check_plane_state from atomic_check Hans de Goede
2018-09-29 12:18 ` [PATCH resend 14/15] staging: vboxvideo: Drop unnecessary drm_connector_helper_funcs callbacks Hans de Goede
2018-09-29 12:18 ` [PATCH resend 15/15] staging: vboxvideo: Use more drm_fb_helper functions Hans de Goede
2018-10-01  7:25 ` [PATCH resend 00/15] staging: vboxvideo: Convert to atomic modesetting API Dan Carpenter
2018-10-01  9:20   ` Hans de Goede
2018-10-05 16:01     ` Daniel Vetter
2018-10-06  8:12       ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180929121825.25765-8-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=michael.thayer@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox