All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	hdegoede@redhat.com, david@lechnology.com, noralf@tronnes.org,
	sean@poorly.run, oleksandr_andrushchenko@epam.com,
	sam@ravnborg.org, laurent.pinchart@ideasonboard.com,
	emil.velikov@collabora.com
Cc: xen-devel@lists.xenproject.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org
Subject: [PATCH v2 3/4] drm/cirrus: Let DRM core send VBLANK events
Date: Wed, 15 Jan 2020 13:52:25 +0100	[thread overview]
Message-ID: <20200115125226.13843-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20200115125226.13843-1-tzimmermann@suse.de>

In drm_atomic_helper_fake_vblank(), the DRM core sends out VBLANK
events if struct drm_crtc_state.no_vblank is enabled. Replace cirrus'
VBLANK events with the DRM core's functionality.

v2:
	* set struct_drm_crtc_state.no_vblank in cirrus_pipe_check()

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/cirrus/cirrus.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 248c9f765c45..5ff15e8a2a0a 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -38,7 +38,6 @@
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
-#include <drm/drm_vblank.h>
 
 #define DRIVER_NAME "cirrus"
 #define DRIVER_DESC "qemu cirrus vga"
@@ -404,6 +403,8 @@ static int cirrus_pipe_check(struct drm_simple_display_pipe *pipe,
 {
 	struct drm_framebuffer *fb = plane_state->fb;
 
+	crtc_state->no_vblank = true;
+
 	if (!fb)
 		return 0;
 	return cirrus_check_size(fb->width, fb->height, fb);
@@ -434,13 +435,6 @@ static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
 
 	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
 		cirrus_fb_blit_rect(pipe->plane.state->fb, &rect);
-
-	if (crtc->state->event) {
-		spin_lock_irq(&crtc->dev->event_lock);
-		drm_crtc_send_vblank_event(crtc, crtc->state->event);
-		crtc->state->event = NULL;
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
 }
 
 static const struct drm_simple_display_pipe_funcs cirrus_pipe_funcs = {
-- 
2.24.1

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	hdegoede@redhat.com, david@lechnology.com, noralf@tronnes.org,
	sean@poorly.run, oleksandr_andrushchenko@epam.com,
	sam@ravnborg.org, laurent.pinchart@ideasonboard.com,
	emil.velikov@collabora.com
Cc: xen-devel@lists.xenproject.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org
Subject: [PATCH v2 3/4] drm/cirrus: Let DRM core send VBLANK events
Date: Wed, 15 Jan 2020 13:52:25 +0100	[thread overview]
Message-ID: <20200115125226.13843-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20200115125226.13843-1-tzimmermann@suse.de>

In drm_atomic_helper_fake_vblank(), the DRM core sends out VBLANK
events if struct drm_crtc_state.no_vblank is enabled. Replace cirrus'
VBLANK events with the DRM core's functionality.

v2:
	* set struct_drm_crtc_state.no_vblank in cirrus_pipe_check()

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/cirrus/cirrus.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 248c9f765c45..5ff15e8a2a0a 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -38,7 +38,6 @@
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
-#include <drm/drm_vblank.h>
 
 #define DRIVER_NAME "cirrus"
 #define DRIVER_DESC "qemu cirrus vga"
@@ -404,6 +403,8 @@ static int cirrus_pipe_check(struct drm_simple_display_pipe *pipe,
 {
 	struct drm_framebuffer *fb = plane_state->fb;
 
+	crtc_state->no_vblank = true;
+
 	if (!fb)
 		return 0;
 	return cirrus_check_size(fb->width, fb->height, fb);
@@ -434,13 +435,6 @@ static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
 
 	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
 		cirrus_fb_blit_rect(pipe->plane.state->fb, &rect);
-
-	if (crtc->state->event) {
-		spin_lock_irq(&crtc->dev->event_lock);
-		drm_crtc_send_vblank_event(crtc, crtc->state->event);
-		crtc->state->event = NULL;
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
 }
 
 static const struct drm_simple_display_pipe_funcs cirrus_pipe_funcs = {
-- 
2.24.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Thomas Zimmermann <tzimmermann@suse.de>
To: airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com,
	maarten.lankhorst@linux.intel.com, mripard@kernel.org,
	hdegoede@redhat.com, david@lechnology.com, noralf@tronnes.org,
	sean@poorly.run, oleksandr_andrushchenko@epam.com,
	sam@ravnborg.org, laurent.pinchart@ideasonboard.com,
	emil.velikov@collabora.com
Cc: xen-devel@lists.xenproject.org,
	Thomas Zimmermann <tzimmermann@suse.de>,
	dri-devel@lists.freedesktop.org,
	virtualization@lists.linux-foundation.org
Subject: [Xen-devel] [PATCH v2 3/4] drm/cirrus: Let DRM core send VBLANK events
Date: Wed, 15 Jan 2020 13:52:25 +0100	[thread overview]
Message-ID: <20200115125226.13843-4-tzimmermann@suse.de> (raw)
In-Reply-To: <20200115125226.13843-1-tzimmermann@suse.de>

In drm_atomic_helper_fake_vblank(), the DRM core sends out VBLANK
events if struct drm_crtc_state.no_vblank is enabled. Replace cirrus'
VBLANK events with the DRM core's functionality.

v2:
	* set struct_drm_crtc_state.no_vblank in cirrus_pipe_check()

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 drivers/gpu/drm/cirrus/cirrus.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c
index 248c9f765c45..5ff15e8a2a0a 100644
--- a/drivers/gpu/drm/cirrus/cirrus.c
+++ b/drivers/gpu/drm/cirrus/cirrus.c
@@ -38,7 +38,6 @@
 #include <drm/drm_modeset_helper_vtables.h>
 #include <drm/drm_probe_helper.h>
 #include <drm/drm_simple_kms_helper.h>
-#include <drm/drm_vblank.h>
 
 #define DRIVER_NAME "cirrus"
 #define DRIVER_DESC "qemu cirrus vga"
@@ -404,6 +403,8 @@ static int cirrus_pipe_check(struct drm_simple_display_pipe *pipe,
 {
 	struct drm_framebuffer *fb = plane_state->fb;
 
+	crtc_state->no_vblank = true;
+
 	if (!fb)
 		return 0;
 	return cirrus_check_size(fb->width, fb->height, fb);
@@ -434,13 +435,6 @@ static void cirrus_pipe_update(struct drm_simple_display_pipe *pipe,
 
 	if (drm_atomic_helper_damage_merged(old_state, state, &rect))
 		cirrus_fb_blit_rect(pipe->plane.state->fb, &rect);
-
-	if (crtc->state->event) {
-		spin_lock_irq(&crtc->dev->event_lock);
-		drm_crtc_send_vblank_event(crtc, crtc->state->event);
-		crtc->state->event = NULL;
-		spin_unlock_irq(&crtc->dev->event_lock);
-	}
 }
 
 static const struct drm_simple_display_pipe_funcs cirrus_pipe_funcs = {
-- 
2.24.1


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  parent reply	other threads:[~2020-01-15 12:52 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-15 12:52 [PATCH v2 0/4] Use no_vblank property for drivers without VBLANK Thomas Zimmermann
2020-01-15 12:52 ` [Xen-devel] " Thomas Zimmermann
2020-01-15 12:52 ` Thomas Zimmermann
2020-01-15 12:52 ` [PATCH v2 1/4] drm: Document struct drm_crtc_state.no_vblank for faking VBLANK events Thomas Zimmermann
2020-01-15 12:52   ` [Xen-devel] " Thomas Zimmermann
2020-01-15 12:52   ` Thomas Zimmermann
2020-01-15 12:52 ` [PATCH v2 2/4] drm/ast: Set struct drm_crtc_state.no_vblank in atomic_check() Thomas Zimmermann
2020-01-15 12:52   ` [Xen-devel] " Thomas Zimmermann
2020-01-15 12:52   ` Thomas Zimmermann
2020-01-15 12:52 ` Thomas Zimmermann [this message]
2020-01-15 12:52   ` [Xen-devel] [PATCH v2 3/4] drm/cirrus: Let DRM core send VBLANK events Thomas Zimmermann
2020-01-15 12:52   ` Thomas Zimmermann
2020-01-15 12:52 ` [PATCH v2 4/4] drm/simple-kms: Let DRM core send VBLANK events by default Thomas Zimmermann
2020-01-15 12:52   ` [Xen-devel] " Thomas Zimmermann
2020-01-15 12:52   ` Thomas Zimmermann
2020-01-16  6:41   ` Daniel Vetter
2020-01-16  6:41     ` [Xen-devel] " Daniel Vetter
2020-01-16  6:41     ` Daniel Vetter
2020-01-16  7:37     ` Thomas Zimmermann
2020-01-16  7:37       ` [Xen-devel] " Thomas Zimmermann
2020-01-16  7:37       ` Thomas Zimmermann
2020-01-16 17:22       ` Emil Velikov
2020-01-16 17:22         ` [Xen-devel] " Emil Velikov
2020-01-16 17:22         ` Emil Velikov
2020-01-16 23:59         ` Daniel Vetter
2020-01-16 23:59           ` [Xen-devel] " Daniel Vetter
2020-01-16 23:59           ` Daniel Vetter
2020-01-17  7:17           ` Thomas Zimmermann
2020-01-17  7:17             ` [Xen-devel] " Thomas Zimmermann
2020-01-17  7:17             ` Thomas Zimmermann
2020-01-22  8:11             ` Daniel Vetter
2020-01-22  8:11               ` [Xen-devel] " Daniel Vetter
2020-01-22  8:11               ` Daniel Vetter
2020-01-22  8:20               ` Thomas Zimmermann
2020-01-22  8:20                 ` [Xen-devel] " Thomas Zimmermann
2020-01-22  8:20                 ` Thomas Zimmermann
2020-01-15 13:04 ` [PATCH v2 0/4] Use no_vblank property for drivers without VBLANK Hans de Goede
2020-01-15 13:04   ` [Xen-devel] " Hans de Goede
2020-01-15 13:04   ` Hans de Goede
  -- strict thread matches above, loose matches on Subject: below --
2020-01-13 10:38 Thomas Zimmermann
2020-01-13 10:38 ` [PATCH v2 3/4] drm/cirrus: Let DRM core send VBLANK events Thomas Zimmermann

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=20200115125226.13843-4-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=david@lechnology.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.velikov@collabora.com \
    --cc=hdegoede@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=noralf@tronnes.org \
    --cc=oleksandr_andrushchenko@epam.com \
    --cc=sam@ravnborg.org \
    --cc=sean@poorly.run \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.