Skip to contentSkip to conversation

drm/exynos: remove leftover code using event_list

PATCH In review Gustavo Padovan 4 participants 29 messages Jan 23, 2015 – Feb 4, 2015

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/6 drm/exynos: remove leftover code using event_list

From: Gustavo Padovan <[email protected]>

The drm_file event_list hasn't been used anymore by exynos, so we don't need any code to clean it.

---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -5
index 25ba362..b60fd9b 100644
@@ -256,11 +256,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 		}
 	}
 
-	/* Release all events handled by page flip handler but not freed. */
-	list_for_each_entry_safe(e, et, &file->event_list, link) {
-		list_del(&e->link);
-		e->destroy(e);
-	}
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 
 	kfree(file->driver_priv);
Signature · 1 line
1.9.3
#1 lore raw

PATCH 2/6 drm/exynos: track vblank events on a per crtc basis

From: Mandeep Singh Baines <[email protected]>

The goal of the change is to make sure we send the vblank event on the current vblank. My hope is to fix any races that might be causing flicker. After this change I only see a flicker in the transition plymouth and X11.

Simplified the code by tracking vblank events on a per-crtc basis. This allowed me to remove all error paths from the callback. It also allowed me to remove the vblank wait from the callback.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 39 ++++++++------------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.c  | 19 ----------------
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |  6 ++---
 3 files changed, 12 insertions(+), 52 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +10 -29
index a85c451..b1f1b25 100644
@@ -34,9 +34,8 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
 	if (mode > DRM_MODE_DPMS_ON) {
 		/* wait for the completion of page flip. */
 		if (!wait_event_timeout(exynos_crtc->pending_flip_queue,
-				!atomic_read(&exynos_crtc->pending_flip),
-				HZ/20))
-			atomic_set(&exynos_crtc->pending_flip, 0);
+				(exynos_crtc->event == NULL), HZ/20))
+			exynos_crtc->event = NULL;
 		drm_crtc_vblank_off(crtc);
 	}
 
@@ -166,7 +165,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 				     uint32_t page_flip_flags)
 {
 	struct drm_device *dev = crtc->dev;
-	struct exynos_drm_private *dev_priv = dev->dev_private;
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
 	struct drm_framebuffer *old_fb = crtc->primary->fb;
 	unsigned int crtc_w, crtc_h;
@@ -194,12 +192,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 			goto out;
 		}
 
-		spin_lock_irq(&dev->event_lock);
-		list_add_tail(&event->base.link,
-				&dev_priv->pageflip_event_list);
-		atomic_set(&exynos_crtc->pending_flip, 1);
-		spin_unlock_irq(&dev->event_lock);
-
 		crtc->primary->fb = fb;
 		crtc_w = fb->width - crtc->x;
 		crtc_h = fb->height - crtc->y;
@@ -209,14 +201,12 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		if (ret) {
 			crtc->primary->fb = old_fb;
 
-			spin_lock_irq(&dev->event_lock);
 			drm_vblank_put(dev, exynos_crtc->pipe);
-			list_del(&event->base.link);
-			atomic_set(&exynos_crtc->pending_flip, 0);
-			spin_unlock_irq(&dev->event_lock);
 
 			goto out;
 		}
+
+		exynos_crtc->event = event;
 	}
 out:
 	mutex_unlock(&dev->struct_mutex);
@@ -315,7 +305,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 		return ERR_PTR(-ENOMEM);
 
 	init_waitqueue_head(&exynos_crtc->pending_flip_queue);
-	atomic_set(&exynos_crtc->pending_flip, 0);
 
 	exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
 	exynos_crtc->pipe = pipe;
@@ -382,27 +371,19 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)
 void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)
 {
 	struct exynos_drm_private *dev_priv = dev->dev_private;
-	struct drm_pending_vblank_event *e, *t;
 	struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
-	unsigned long flags;
 
-	spin_lock_irqsave(&dev->event_lock, flags);
+	if (exynos_crtc->event) {
 
-	list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-			base.link) {
-		/* if event's pipe isn't same as crtc then ignore it. */
-		if (pipe != e->pipe)
-			continue;
-
-		list_del(&e->base.link);
-		drm_send_vblank_event(dev, -1, e);
+		spin_lock_irq(&dev->event_lock);
+		drm_send_vblank_event(dev, -1, exynos_crtc->event);
 		drm_vblank_put(dev, pipe);
-		atomic_set(&exynos_crtc->pending_flip, 0);
 		wake_up(&exynos_crtc->pending_flip_queue);
-	}
+		spin_unlock_irq(&dev->event_lock);
 
-	spin_unlock_irqrestore(&dev->event_lock, flags);
+		exynos_crtc->event = NULL;
+	}
 }
 
 void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb)
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -19
index b60fd9b..731cdbc 100644
@@ -61,7 +61,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 	if (!private)
 		return -ENOMEM;
 
-	INIT_LIST_HEAD(&private->pageflip_event_list);
 	dev_set_drvdata(dev->dev, dev);
 	dev->dev_private = (void *)private;
 
@@ -237,27 +236,9 @@ static void exynos_drm_preclose(struct drm_device *dev,
 
 static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 {
-	struct exynos_drm_private *private = dev->dev_private;
-	struct drm_pending_vblank_event *v, *vt;
-	struct drm_pending_event *e, *et;
-	unsigned long flags;
-
 	if (!file->driver_priv)
 		return;
 
-	/* Release all events not unhandled by page flip handler. */
-	spin_lock_irqsave(&dev->event_lock, flags);
-	list_for_each_entry_safe(v, vt, &private->pageflip_event_list,
-			base.link) {
-		if (v->base.file_priv == file) {
-			list_del(&v->base.link);
-			drm_vblank_put(dev, v->pipe);
-			v->base.destroy(&v->base);
-		}
-	}
-
-	spin_unlock_irqrestore(&dev->event_lock, flags);
-
 	kfree(file->driver_priv);
 	file->driver_priv = NULL;
 }
drivers/gpu/drm/exynos/exynos_drm_drv.h +2 -4
index d490b49..7411af2 100644
@@ -216,6 +216,7 @@ enum exynos_crtc_mode {
  *	this pipe value.
  * @dpms: store the crtc dpms value
  * @mode: store the crtc mode value
+ * @event: vblank event that is currently queued for flip
  * @ops: pointer to callbacks for exynos drm specific functionality
  * @ctx: A pointer to the crtc's implementation specific context
  */
@@ -226,7 +227,7 @@ struct exynos_drm_crtc {
 	unsigned int			dpms;
 	enum exynos_crtc_mode		mode;
 	wait_queue_head_t		pending_flip_queue;
-	atomic_t			pending_flip;
+	struct drm_pending_vblank_event	*event;
 	struct exynos_drm_crtc_ops	*ops;
 	void				*ctx;
 };
@@ -256,9 +257,6 @@ struct drm_exynos_file_private {
 struct exynos_drm_private {
 	struct drm_fb_helper *fb_helper;
 
-	/* list head for new event to be added. */
-	struct list_head pageflip_event_list;
-
 	/*
 	 * created crtc object would be contained at this array and
 	 * this array is used to be aware of which crtc did it request vblank.
Signature · 6 lines
1.9.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Re: [PATCH 2/6] drm/exynos: track vblank events on a per crtc basis

Hi,

Quoted 21 lines · Gustavo Padovan

void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)

 {
        struct exynos_drm_private *dev_priv = dev->dev_private;
drivers/gpu/drm/exynos/exynos_drm_crtc.c +3 -11
-       struct drm_pending_vblank_event *e, *t;
        struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
        struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
-       unsigned long flags;
 
-       spin_lock_irqsave(&dev->event_lock, flags);
+       if (exynos_crtc->event) {
 
-       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-                       base.link) {
-               /* if event's pipe isn't same as crtc then ignore it. */
-               if (pipe != e->pipe)
-                       continue;
-
-               list_del(&e->base.link);
-               drm_send_vblank_event(dev, -1, e);
+               spin_lock_irq(&dev->event_lock);
+               drm_send_vblank_event(dev, -1, exynos_crtc->event);

drivers/gpu/drm/exynos/exynos_drm_crtc.c void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe) · line 387

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +3 -3
                drm_vblank_put(dev, pipe);
-               atomic_set(&exynos_crtc->pending_flip, 0);
                wake_up(&exynos_crtc->pending_flip_queue);
-       }
+               spin_unlock_irq(&dev->event_lock);
 
-       spin_unlock_irqrestore(&dev->event_lock, flags);
+               exynos_crtc->event = NULL;
+       }
 }

Doesn't this need to hold the CRTC lock to not race with, e.g, the page_flip caller? This gets called from IRQ context though, so might need conversion to soft-IRQ to do so, or another per-CRTC spinlock just to protect the event.

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw

Re: [PATCH 2/6] drm/exynos: track vblank events on a per crtc basis

Quoted 35 lines · Daniel Stone

Hi,

Quoted 21 lines · Gustavo Padovan

void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)

 {
        struct exynos_drm_private *dev_priv = dev->dev_private;
drivers/gpu/drm/exynos/exynos_drm_crtc.c +3 -11
-       struct drm_pending_vblank_event *e, *t;
        struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
        struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
-       unsigned long flags;
 
-       spin_lock_irqsave(&dev->event_lock, flags);
+       if (exynos_crtc->event) {
 
-       list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-                       base.link) {
-               /* if event's pipe isn't same as crtc then ignore it. */
-               if (pipe != e->pipe)
-                       continue;
-
-               list_del(&e->base.link);
-               drm_send_vblank_event(dev, -1, e);
+               spin_lock_irq(&dev->event_lock);
+               drm_send_vblank_event(dev, -1, exynos_crtc->event);

drivers/gpu/drm/exynos/exynos_drm_crtc.c void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe) · line 387

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +3 -3
                drm_vblank_put(dev, pipe);
-               atomic_set(&exynos_crtc->pending_flip, 0);
                wake_up(&exynos_crtc->pending_flip_queue);
-       }
+               spin_unlock_irq(&dev->event_lock);
 
-       spin_unlock_irqrestore(&dev->event_lock, flags);
+               exynos_crtc->event = NULL;
+       }
 }
Quoted 4 lines

Doesn't this need to hold the CRTC lock to not race with, e.g, the page_flip caller? This gets called from IRQ context though, so might need conversion to soft-IRQ to do so, or another per-CRTC spinlock just to protect the event.

dev->even_lock should be enough, but I suspect that lock also protects exynos_crtc->event (at least that's the case in i915.ko). So would need to be moved out of the if block again.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#4 lore raw

PATCH 1/1 drm/exynos: track vblank events on a per crtc basis

In reply to Gustavo Padovan

From: Mandeep Singh Baines <[email protected]>

The goal of the change is to make sure we send the vblank event on the current vblank. My hope is to fix any races that might be causing flicker. After this change I only see a flicker in the transition plymouth and X11.

Simplified the code by tracking vblank events on a per-crtc basis. This allowed me to remove all error paths from the callback. It also allowed me to remove the vblank wait from the callback.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 29 +++++++----------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.c  | 19 -------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |  6 ++----
 3 files changed, 9 insertions(+), 45 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +7 -22
index a85c451..91c175b 100644
@@ -34,9 +34,8 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
 	if (mode > DRM_MODE_DPMS_ON) {
 		/* wait for the completion of page flip. */
 		if (!wait_event_timeout(exynos_crtc->pending_flip_queue,
-				!atomic_read(&exynos_crtc->pending_flip),
-				HZ/20))
-			atomic_set(&exynos_crtc->pending_flip, 0);
+				(exynos_crtc->event == NULL), HZ/20))
+			exynos_crtc->event = NULL;
 		drm_crtc_vblank_off(crtc);
 	}
 
@@ -166,7 +165,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 				     uint32_t page_flip_flags)
 {
 	struct drm_device *dev = crtc->dev;
-	struct exynos_drm_private *dev_priv = dev->dev_private;
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
 	struct drm_framebuffer *old_fb = crtc->primary->fb;
 	unsigned int crtc_w, crtc_h;
@@ -195,9 +193,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		}
 
 		spin_lock_irq(&dev->event_lock);
-		list_add_tail(&event->base.link,
-				&dev_priv->pageflip_event_list);
-		atomic_set(&exynos_crtc->pending_flip, 1);
+		exynos_crtc->event = event;
 		spin_unlock_irq(&dev->event_lock);
 
 		crtc->primary->fb = fb;
@@ -209,11 +205,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		if (ret) {
 			crtc->primary->fb = old_fb;
 
-			spin_lock_irq(&dev->event_lock);
 			drm_vblank_put(dev, exynos_crtc->pipe);
-			list_del(&event->base.link);
-			atomic_set(&exynos_crtc->pending_flip, 0);
-			spin_unlock_irq(&dev->event_lock);
 
 			goto out;
 		}
@@ -315,7 +307,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 		return ERR_PTR(-ENOMEM);
 
 	init_waitqueue_head(&exynos_crtc->pending_flip_queue);
-	atomic_set(&exynos_crtc->pending_flip, 0);
 
 	exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
 	exynos_crtc->pipe = pipe;
@@ -382,26 +373,20 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)
 void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)
 {
 	struct exynos_drm_private *dev_priv = dev->dev_private;
-	struct drm_pending_vblank_event *e, *t;
 	struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
 	unsigned long flags;
 
 	spin_lock_irqsave(&dev->event_lock, flags);
+	if (exynos_crtc->event) {
 
-	list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-			base.link) {
-		/* if event's pipe isn't same as crtc then ignore it. */
-		if (pipe != e->pipe)
-			continue;
-
-		list_del(&e->base.link);
-		drm_send_vblank_event(dev, -1, e);
+		drm_send_vblank_event(dev, -1, exynos_crtc->event);
 		drm_vblank_put(dev, pipe);
-		atomic_set(&exynos_crtc->pending_flip, 0);
 		wake_up(&exynos_crtc->pending_flip_queue);
+
 	}
 
+	exynos_crtc->event = NULL;
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -19
index b60fd9b..731cdbc 100644
@@ -61,7 +61,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 	if (!private)
 		return -ENOMEM;
 
-	INIT_LIST_HEAD(&private->pageflip_event_list);
 	dev_set_drvdata(dev->dev, dev);
 	dev->dev_private = (void *)private;
 
@@ -237,27 +236,9 @@ static void exynos_drm_preclose(struct drm_device *dev,
 
 static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 {
-	struct exynos_drm_private *private = dev->dev_private;
-	struct drm_pending_vblank_event *v, *vt;
-	struct drm_pending_event *e, *et;
-	unsigned long flags;
-
 	if (!file->driver_priv)
 		return;
 
-	/* Release all events not unhandled by page flip handler. */
-	spin_lock_irqsave(&dev->event_lock, flags);
-	list_for_each_entry_safe(v, vt, &private->pageflip_event_list,
-			base.link) {
-		if (v->base.file_priv == file) {
-			list_del(&v->base.link);
-			drm_vblank_put(dev, v->pipe);
-			v->base.destroy(&v->base);
-		}
-	}
-
-	spin_unlock_irqrestore(&dev->event_lock, flags);
-
 	kfree(file->driver_priv);
 	file->driver_priv = NULL;
 }
drivers/gpu/drm/exynos/exynos_drm_drv.h +2 -4
index d490b49..7411af2 100644
@@ -216,6 +216,7 @@ enum exynos_crtc_mode {
  *	this pipe value.
  * @dpms: store the crtc dpms value
  * @mode: store the crtc mode value
+ * @event: vblank event that is currently queued for flip
  * @ops: pointer to callbacks for exynos drm specific functionality
  * @ctx: A pointer to the crtc's implementation specific context
  */
@@ -226,7 +227,7 @@ struct exynos_drm_crtc {
 	unsigned int			dpms;
 	enum exynos_crtc_mode		mode;
 	wait_queue_head_t		pending_flip_queue;
-	atomic_t			pending_flip;
+	struct drm_pending_vblank_event	*event;
 	struct exynos_drm_crtc_ops	*ops;
 	void				*ctx;
 };
@@ -256,9 +257,6 @@ struct drm_exynos_file_private {
 struct exynos_drm_private {
 	struct drm_fb_helper *fb_helper;
 
-	/* list head for new event to be added. */
-	struct list_head pageflip_event_list;
-
 	/*
 	 * created crtc object would be contained at this array and
 	 * this array is used to be aware of which crtc did it request vblank.
Signature · 6 lines
1.9.3

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

Re: [PATCH -v2] drm/exynos: track vblank events on a per crtc basis

+Cc Inki,

Hi,

Quoted 44 lines · Gustavo Padovan

From: Mandeep Singh Baines <[email protected]>

The goal of the change is to make sure we send the vblank event on the current vblank. My hope is to fix any races that might be causing flicker. After this change I only see a flicker in the transition plymouth and X11.

Simplified the code by tracking vblank events on a per-crtc basis. This allowed me to remove all error paths from the callback. It also allowed me to remove the vblank wait from the callback.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 29 +++++++----------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.c  | 19 -------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |  6 ++----
 3 files changed, 9 insertions(+), 45 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +2 -4
index a85c451..91c175b 100644
@@ -34,9 +34,8 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
 	if (mode > DRM_MODE_DPMS_ON) {
 		/* wait for the completion of page flip. */
 		if (!wait_event_timeout(exynos_crtc->pending_flip_queue,
-				!atomic_read(&exynos_crtc->pending_flip),
-				HZ/20))
-			atomic_set(&exynos_crtc->pending_flip, 0);
+				(exynos_crtc->event == NULL), HZ/20))
+			exynos_crtc->event = NULL;
 		drm_crtc_vblank_off(crtc);
 	}
 
@@ -166,7 +165,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 				     uint32_t page_flip_flags)
 {
 	struct drm_device *dev = crtc->dev;
-	struct exynos_drm_private *dev_priv = dev->dev_private;
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
 	struct drm_framebuffer *old_fb = crtc->primary->fb;
 	unsigned int crtc_w, crtc_h;

drivers/gpu/drm/exynos/exynos_drm_crtc.c static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, · line 196

Quoted 7 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -3
@@ -195,9 +193,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		}
 
 		spin_lock_irq(&dev->event_lock);
-		list_add_tail(&event->base.link,
-				&dev_priv->pageflip_event_list);
-		atomic_set(&exynos_crtc->pending_flip, 1);
+		exynos_crtc->event = event;

We will lose unfinished prior events by this change. That's why we use linked list.

Thanks.

Quoted 126 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +4 -15
 		spin_unlock_irq(&dev->event_lock);
 
 		crtc->primary->fb = fb;
@@ -209,11 +205,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		if (ret) {
 			crtc->primary->fb = old_fb;
 
-			spin_lock_irq(&dev->event_lock);
 			drm_vblank_put(dev, exynos_crtc->pipe);
-			list_del(&event->base.link);
-			atomic_set(&exynos_crtc->pending_flip, 0);
-			spin_unlock_irq(&dev->event_lock);
 
 			goto out;
 		}
@@ -315,7 +307,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 		return ERR_PTR(-ENOMEM);
 
 	init_waitqueue_head(&exynos_crtc->pending_flip_queue);
-	atomic_set(&exynos_crtc->pending_flip, 0);
 
 	exynos_crtc->dpms = DRM_MODE_DPMS_OFF;
 	exynos_crtc->pipe = pipe;
@@ -382,26 +373,20 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)
 void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)
 {
 	struct exynos_drm_private *dev_priv = dev->dev_private;
-	struct drm_pending_vblank_event *e, *t;
 	struct drm_crtc *drm_crtc = dev_priv->crtc[pipe];
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(drm_crtc);
 	unsigned long flags;
 
 	spin_lock_irqsave(&dev->event_lock, flags);
+	if (exynos_crtc->event) {
 
-	list_for_each_entry_safe(e, t, &dev_priv->pageflip_event_list,
-			base.link) {
-		/* if event's pipe isn't same as crtc then ignore it. */
-		if (pipe != e->pipe)
-			continue;
-
-		list_del(&e->base.link);
-		drm_send_vblank_event(dev, -1, e);
+		drm_send_vblank_event(dev, -1, exynos_crtc->event);
 		drm_vblank_put(dev, pipe);
-		atomic_set(&exynos_crtc->pending_flip, 0);
 		wake_up(&exynos_crtc->pending_flip_queue);
+
 	}
 
+	exynos_crtc->event = NULL;
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 }
 
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -19
index b60fd9b..731cdbc 100644
@@ -61,7 +61,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 	if (!private)
 		return -ENOMEM;
 
-	INIT_LIST_HEAD(&private->pageflip_event_list);
 	dev_set_drvdata(dev->dev, dev);
 	dev->dev_private = (void *)private;
 
@@ -237,27 +236,9 @@ static void exynos_drm_preclose(struct drm_device *dev,
 
 static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 {
-	struct exynos_drm_private *private = dev->dev_private;
-	struct drm_pending_vblank_event *v, *vt;
-	struct drm_pending_event *e, *et;
-	unsigned long flags;
-
 	if (!file->driver_priv)
 		return;
 
-	/* Release all events not unhandled by page flip handler. */
-	spin_lock_irqsave(&dev->event_lock, flags);
-	list_for_each_entry_safe(v, vt, &private->pageflip_event_list,
-			base.link) {
-		if (v->base.file_priv == file) {
-			list_del(&v->base.link);
-			drm_vblank_put(dev, v->pipe);
-			v->base.destroy(&v->base);
-		}
-	}
-
-	spin_unlock_irqrestore(&dev->event_lock, flags);
-
 	kfree(file->driver_priv);
 	file->driver_priv = NULL;
 }
drivers/gpu/drm/exynos/exynos_drm_drv.h +2 -4
index d490b49..7411af2 100644
@@ -216,6 +216,7 @@ enum exynos_crtc_mode {
  *	this pipe value.
  * @dpms: store the crtc dpms value
  * @mode: store the crtc mode value
+ * @event: vblank event that is currently queued for flip
  * @ops: pointer to callbacks for exynos drm specific functionality
  * @ctx: A pointer to the crtc's implementation specific context
  */
@@ -226,7 +227,7 @@ struct exynos_drm_crtc {
 	unsigned int			dpms;
 	enum exynos_crtc_mode		mode;
 	wait_queue_head_t		pending_flip_queue;
-	atomic_t			pending_flip;
+	struct drm_pending_vblank_event	*event;
 	struct exynos_drm_crtc_ops	*ops;
 	void				*ctx;
 };
@@ -256,9 +257,6 @@ struct drm_exynos_file_private {
 struct exynos_drm_private {
 	struct drm_fb_helper *fb_helper;
 
-	/* list head for new event to be added. */
-	struct list_head pageflip_event_list;
-
 	/*
 	 * created crtc object would be contained at this array and
 	 * this array is used to be aware of which crtc did it request vblank.
#6 lore raw

Re: [PATCH -v2] drm/exynos: track vblank events on a per crtc basis

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 51 lines

+Cc Inki,

Hi,

Quoted 46 lines · Gustavo Padovan

From: Mandeep Singh Baines <[email protected]>

The goal of the change is to make sure we send the vblank event on the current vblank. My hope is to fix any races that might be causing flicker. After this change I only see a flicker in the transition plymouth and X11.

Simplified the code by tracking vblank events on a per-crtc basis. This allowed me to remove all error paths from the callback. It also allowed me to remove the vblank wait from the callback.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 29 +++++++----------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.c  | 19 -------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.h  |  6 ++----
 3 files changed, 9 insertions(+), 45 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +2 -4
index a85c451..91c175b 100644
@@ -34,9 +34,8 @@ static void exynos_drm_crtc_dpms(struct drm_crtc *crtc, int mode)
 	if (mode > DRM_MODE_DPMS_ON) {
 		/* wait for the completion of page flip. */
 		if (!wait_event_timeout(exynos_crtc->pending_flip_queue,
-				!atomic_read(&exynos_crtc->pending_flip),
-				HZ/20))
-			atomic_set(&exynos_crtc->pending_flip, 0);
+				(exynos_crtc->event == NULL), HZ/20))
+			exynos_crtc->event = NULL;
 		drm_crtc_vblank_off(crtc);
 	}
 
@@ -166,7 +165,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 				     uint32_t page_flip_flags)
 {
 	struct drm_device *dev = crtc->dev;
-	struct exynos_drm_private *dev_priv = dev->dev_private;
 	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
 	struct drm_framebuffer *old_fb = crtc->primary->fb;
 	unsigned int crtc_w, crtc_h;
@@ -195,9 +193,7 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
 		}
 
Quoted 8 lines

drivers/gpu/drm/exynos/exynos_drm_crtc.c static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc, · line 196

Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -3
 		spin_lock_irq(&dev->event_lock);
-		list_add_tail(&event->base.link,
-				&dev_priv->pageflip_event_list);
-		atomic_set(&exynos_crtc->pending_flip, 1);
+		exynos_crtc->event = event;

We will lose unfinished prior events by this change. That's why we use linked list.

I think you are right, but I was using exynos_crtc->event to do exactly the same as exynos_crtc->pending_flip. So we were losing a event in exynos_drm_crtc_dpms() before too. I change this patch to have a page_flip list on the crtc.

Gustavo

#7 lore raw

Re: [PATCH -v2] drm/exynos: track vblank events on a per crtc basis

Hi,

Quoted 8 lines · Gustavo Padovan

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 2 lines

We will lose unfinished prior events by this change. That's why we use linked list.

I think you are right, but I was using exynos_crtc->event to do exactly the same as exynos_crtc->pending_flip. So we were losing a event in exynos_drm_crtc_dpms() before too. I change this patch to have a page_flip list on the crtc.

The usual approach in other drivers is to return -EBUSY when there is already an async pageflip pending. This definitely makes sense to me, as I don't see the point of submitting pageflips faster than the hardware can actually render, and pretending to the application that they were actually shown.

Cheers,
Daniel
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw

Re: [PATCH -v2] drm/exynos: track vblank events on a per crtc basis

Quoted 12 lines · Daniel Stone

Hi,

Quoted 8 lines · Gustavo Padovan

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 2 lines

We will lose unfinished prior events by this change. That's why we use linked list.

I think you are right, but I was using exynos_crtc->event to do exactly the same as exynos_crtc->pending_flip. So we were losing a event in exynos_drm_crtc_dpms() before too. I change this patch to have a page_flip list on the crtc.

Quoted 5 lines

The usual approach in other drivers is to return -EBUSY when there is already an async pageflip pending. This definitely makes sense to me, as I don't see the point of submitting pageflips faster than the hardware can actually render, and pretending to the application that they were actually shown.

Yes, right now drm doesn't really support anything like a pageflip queue. Same for atomic really. Even the async pageflip mode works like it, it just ends up flipping faster.

Long-term we want a flip queue where subsequent flips can be folded together on the next vblank. That makes benchmark-mode games happy, without resulting in tearing like async flips and still resulting in the lowest possible latency (since the kernel we just commit the flips for which all the buffers are ready and not stall).
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

Re: [PATCH -v2] drm/exynos: track vblank events on a per crtc basis

2015-01-30 Daniel Vetter <[email protected]>:

Quoted 23 lines · Daniel Stone
Quoted 12 lines

Hi,

Quoted 8 lines · Gustavo Padovan

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 2 lines

We will lose unfinished prior events by this change. That's why we use linked list.

I think you are right, but I was using exynos_crtc->event to do exactly the same as exynos_crtc->pending_flip. So we were losing a event in exynos_drm_crtc_dpms() before too. I change this patch to have a page_flip list on the crtc.

Quoted 5 lines

The usual approach in other drivers is to return -EBUSY when there is already an async pageflip pending. This definitely makes sense to me, as I don't see the point of submitting pageflips faster than the hardware can actually render, and pretending to the application that they were actually shown.

Yes, right now drm doesn't really support anything like a pageflip queue. Same for atomic really. Even the async pageflip mode works like it, it just ends up flipping faster.

Quoted 5 lines

Long-term we want a flip queue where subsequent flips can be folded together on the next vblank. That makes benchmark-mode games happy, without resulting in tearing like async flips and still resulting in the lowest possible latency (since the kernel we just commit the flips for which all the buffers are ready and not stall).

Yeah, that makes sense. I'll just add a check for -EBUSY and send a v2.

Gustavo

#10 lore raw

Re: [PATCH -v2] drm/exynos: track vblank events on a per crtc basis

Quoted 25 lines · Gustavo Padovan

2015-01-30 Daniel Vetter <[email protected]>:

Quoted 23 lines · Daniel Stone
Quoted 12 lines

Hi,

Quoted 8 lines · Gustavo Padovan

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 2 lines

We will lose unfinished prior events by this change. That's why we use linked list.

I think you are right, but I was using exynos_crtc->event to do exactly the same as exynos_crtc->pending_flip. So we were losing a event in exynos_drm_crtc_dpms() before too. I change this patch to have a page_flip list on the crtc.

Quoted 5 lines

The usual approach in other drivers is to return -EBUSY when there is already an async pageflip pending. This definitely makes sense to me, as I don't see the point of submitting pageflips faster than the hardware can actually render, and pretending to the application that they were actually shown.

Yes, right now drm doesn't really support anything like a pageflip queue. Same for atomic really. Even the async pageflip mode works like it, it just ends up flipping faster.

Quoted 8 lines
Quoted 5 lines

Long-term we want a flip queue where subsequent flips can be folded together on the next vblank. That makes benchmark-mode games happy, without resulting in tearing like async flips and still resulting in the lowest possible latency (since the kernel we just commit the flips for which all the buffers are ready and not stall).

Yeah, that makes sense. I'll just add a check for -EBUSY and send a v2.

Then it's reasonable to me.

Thanks.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw

PATCH 3/6 drm/exynos: Remove exynos_plane_dpms() call with no effect

In reply to Gustavo Padovan

From: Gustavo Padovan <[email protected]>

exynos_plane_dpms(DRM_MODE_DPMS_ON) calls the win_enable()'s callback from the underlying layer. However neither one of these layers implement win_enable() - FIMD, Mixer and VIDI. Thus the call to exynos_plane_dpms() is pointless.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -2
index b1f1b25..d0f4e1b 100644
@@ -65,8 +65,6 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
 
 	if (exynos_crtc->ops->commit)
 		exynos_crtc->ops->commit(exynos_crtc);
-
-	exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_ON);
 }
 
 static bool
Signature · 1 line
1.9.3
#12 lore raw

Re: [PATCH 3/6] drm/exynos: Remove exynos_plane_dpms() call with no effect

+Cc Inki,

Hi,

Quoted 7 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

exynos_plane_dpms(DRM_MODE_DPMS_ON) calls the win_enable()'s callback from the underlying layer. However neither one of these layers implement win_enable() - FIMD, Mixer and VIDI. Thus the call to exynos_plane_dpms() is pointless.

No, it needs for pair with DRM_MODE_DPMS_OFF case.

Thanks.

Quoted 11 lines
---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 --
 1 file changed, 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -0
index b1f1b25..d0f4e1b 100644

drivers/gpu/drm/exynos/exynos_drm_crtc.c static void exynos_drm_crtc_commit(struct drm_crtc *crtc) · line 70

Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -2
@@ -65,8 +65,6 @@ static void exynos_drm_crtc_commit(struct drm_crtc *crtc)
 
 	if (exynos_crtc->ops->commit)
 		exynos_crtc->ops->commit(exynos_crtc);
-
-	exynos_plane_dpms(crtc->primary, DRM_MODE_DPMS_ON);
 }
 
 static bool

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#13 lore raw

Re: [PATCH 3/6] drm/exynos: Remove exynos_plane_dpms() call with no effect

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 7 lines

+Cc Inki,

Hi,

Quoted 2 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

Quoted 7 lines
Quoted 5 lines

exynos_plane_dpms(DRM_MODE_DPMS_ON) calls the win_enable()'s callback from the underlying layer. However neither one of these layers implement win_enable() - FIMD, Mixer and VIDI. Thus the call to exynos_plane_dpms() is pointless.

No, it needs for pair with DRM_MODE_DPMS_OFF case.

It is a stub call. exynos_plane_dpms(DRM_MODE_DPMS_ON) only calls exynos_crtc->ops->win_enable() however neither FIMD, VIDI or Mixer implements win_enable(). So it has no effect and we can remove this call safely.

Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#14 lore raw

Re: [PATCH 3/6] drm/exynos: Remove exynos_plane_dpms() call with no effect

Quoted 14 lines · Gustavo Padovan

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 12 lines

+Cc Inki,

Hi,

Quoted 7 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

exynos_plane_dpms(DRM_MODE_DPMS_ON) calls the win_enable()'s callback from the underlying layer. However neither one of these layers implement win_enable() - FIMD, Mixer and VIDI. Thus the call to exynos_plane_dpms() is pointless.

Yes, this can be useful in api aspect later.

Quoted 7 lines
Quoted 2 lines

No, it needs for pair with DRM_MODE_DPMS_OFF case.

It is a stub call. exynos_plane_dpms(DRM_MODE_DPMS_ON) only calls exynos_crtc->ops->win_enable() however neither FIMD, VIDI or Mixer implements win_enable(). So it has no effect and we can remove this call safely.

No, we can stop to set duplication by enabled flag of struct exynos_drm_plane, that's why keep fair. Currently the plane is not disabled actually when disable the plane after setplane without below link patch.

http://www.spinics.net/lists/dri-devel/msg76143.html

Thanks.

#15 lore raw

PATCH 4/6 drm/exynos: remove leftover functions declarations

In reply to Gustavo Padovan

From: Gustavo Padovan <[email protected]>

These functions were already removed by previous cleanup work, but these ones were left behind.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.h +0 -6
index 6258b80..628b787 100644
@@ -27,12 +27,6 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);
 void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe);
 void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb);
 
-void exynos_drm_crtc_plane_mode_set(struct drm_crtc *crtc,
-			struct exynos_drm_plane *plane);
-void exynos_drm_crtc_plane_commit(struct drm_crtc *crtc, int zpos);
-void exynos_drm_crtc_plane_enable(struct drm_crtc *crtc, int zpos);
-void exynos_drm_crtc_plane_disable(struct drm_crtc *crtc, int zpos);
-
 /* This function gets pipe value to crtc device matched with out_type. */
 int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,
 					unsigned int out_type);
Signature · 1 line
1.9.3
Acked-by on v1 4/6
#16 lore raw

Re: [PATCH 4/6] drm/exynos: remove leftover functions declarations

+Cc Inki,

Hi,

Quoted 18 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

These functions were already removed by previous cleanup work, but these ones were left behind.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.h | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.h +0 -0
index 6258b80..628b787 100644
@@ -27,12 +27,6 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe);
 void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe);
 void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb);

drivers/gpu/drm/exynos/exynos_drm_crtc.h void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe); · line 32

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.h +0 -6
 
-void exynos_drm_crtc_plane_mode_set(struct drm_crtc *crtc,
-			struct exynos_drm_plane *plane);
-void exynos_drm_crtc_plane_commit(struct drm_crtc *crtc, int zpos);
-void exynos_drm_crtc_plane_enable(struct drm_crtc *crtc, int zpos);
-void exynos_drm_crtc_plane_disable(struct drm_crtc *crtc, int zpos);
-
 /* This function gets pipe value to crtc device matched with out_type. */
 int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev,
 					unsigned int out_type);

Thanks.

#17 lore raw

PATCH 5/6 drm/exynos: remove struct *_win_data abstraction on planes

In reply to Gustavo Padovan

From: Gustavo Padovan <[email protected]>

struct {fimd,mixer,vidi}_win_data was just keeping the same data as struct exynos_drm_plane thus get ride of it and use exynos_drm_plane directly.

It changes how planes are created and remove .win_mode_set() callback that was only filling all *_win_data structs.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |   9 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.h  |   1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  14 --
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |   5 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 181 ++++++++++---------------
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  20 +--
 drivers/gpu/drm/exynos/exynos_drm_plane.h |   6 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 123 ++++-------------
 drivers/gpu/drm/exynos/exynos_mixer.c     | 212 +++++++++++-------------------
 9 files changed, 182 insertions(+), 389 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -8
index d0f4e1b..5cd6c1a 100644
@@ -287,13 +287,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)
 }
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
+					       struct drm_plane *plane,
 					       int pipe,
 					       enum exynos_drm_output_type type,
 					       struct exynos_drm_crtc_ops *ops,
 					       void *ctx)
 {
 	struct exynos_drm_crtc *exynos_crtc;
-	struct drm_plane *plane;
 	struct exynos_drm_private *private = drm_dev->dev_private;
 	struct drm_crtc *crtc;
 	int ret;
@@ -309,12 +309,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 	exynos_crtc->type = type;
 	exynos_crtc->ops = ops;
 	exynos_crtc->ctx = ctx;
-	plane = exynos_plane_init(drm_dev, 1 << pipe,
-				  DRM_PLANE_TYPE_PRIMARY);
-	if (IS_ERR(plane)) {
-		ret = PTR_ERR(plane);
-		goto err_plane;
-	}
 
 	crtc = &exynos_crtc->base;
 
@@ -333,7 +327,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 
 err_crtc:
 	plane->funcs->destroy(plane);
-err_plane:
 	kfree(exynos_crtc);
 	return ERR_PTR(ret);
 }
drivers/gpu/drm/exynos/exynos_drm_crtc.h +1 -0
index 628b787..0ecd8fc 100644
@@ -18,6 +18,7 @@
 #include "exynos_drm_drv.h"
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
+					       struct drm_plane *plane,
 					       int pipe,
 					       enum exynos_drm_output_type type,
 					       struct exynos_drm_crtc_ops *ops,
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -14
index 731cdbc..1fa2a7f 100644
@@ -55,7 +55,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 {
 	struct exynos_drm_private *private;
 	int ret;
-	int nr;
 
 	private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL);
 	if (!private)
@@ -80,19 +79,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
 
 	exynos_drm_mode_config_init(dev);
 
-	for (nr = 0; nr < MAX_PLANE; nr++) {
-		struct drm_plane *plane;
-		unsigned long possible_crtcs = (1 << MAX_CRTC) - 1;
-
-		plane = exynos_plane_init(dev, possible_crtcs,
-					  DRM_PLANE_TYPE_OVERLAY);
-		if (!IS_ERR(plane))
-			continue;
-
-		ret = PTR_ERR(plane);
-		goto err_mode_config_cleanup;
-	}
-
 	/* setup possible_clones. */
 	exynos_drm_encoder_setup(dev);
 
drivers/gpu/drm/exynos/exynos_drm_drv.h +2 -3
index 7411af2..cad54e7 100644
@@ -78,6 +78,7 @@ enum exynos_drm_output_type {
  * @transparency: transparency on or off.
  * @activated: activated or not.
  * @enabled: enabled or not.
+ * @resume: to resume or not.
  *
  * this structure is common to exynos SoC and its contents would be copied
  * to hardware specific overlay info.
@@ -112,6 +113,7 @@ struct exynos_drm_plane {
 	bool transparency:1;
 	bool activated:1;
 	bool enabled:1;
+	bool resume:1;
 };
 
 /*
@@ -172,7 +174,6 @@ struct exynos_drm_display {
  * @disable_vblank: specific driver callback for disabling vblank interrupt.
  * @wait_for_vblank: wait for vblank interrupt to make sure that
  *	hardware overlay is updated.
- * @win_mode_set: copy drm overlay info to hw specific overlay info.
  * @win_commit: apply hardware specific overlay data to registers.
  * @win_enable: enable hardware specific overlay.
  * @win_disable: disable hardware specific overlay.
@@ -189,8 +190,6 @@ struct exynos_drm_crtc_ops {
 	int (*enable_vblank)(struct exynos_drm_crtc *crtc);
 	void (*disable_vblank)(struct exynos_drm_crtc *crtc);
 	void (*wait_for_vblank)(struct exynos_drm_crtc *crtc);
-	void (*win_mode_set)(struct exynos_drm_crtc *crtc,
-				struct exynos_drm_plane *plane);
 	void (*win_commit)(struct exynos_drm_crtc *crtc, int zpos);
 	void (*win_enable)(struct exynos_drm_crtc *crtc, int zpos);
 	void (*win_disable)(struct exynos_drm_crtc *crtc, int zpos);
drivers/gpu/drm/exynos/exynos_drm_fimd.c +67 -114

346 lines not on this page · raw message

drivers/gpu/drm/exynos/exynos_drm_plane.c +5 -15
index 358cff6..dc13621 100644
@@ -93,7 +93,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
 			  uint32_t src_w, uint32_t src_h)
 {
 	struct exynos_drm_plane *exynos_plane = to_exynos_plane(plane);
-	struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc);
 	unsigned int actual_w;
 	unsigned int actual_h;
 
@@ -140,9 +139,6 @@ void exynos_plane_mode_set(struct drm_plane *plane, struct drm_crtc *crtc,
 			exynos_plane->crtc_width, exynos_plane->crtc_height);
 
 	plane->crtc = crtc;
-
-	if (exynos_crtc->ops->win_mode_set)
-		exynos_crtc->ops->win_mode_set(exynos_crtc, exynos_plane);
 }
 
 void exynos_plane_dpms(struct drm_plane *plane, int mode)
@@ -255,24 +251,18 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane)
 	drm_object_attach_property(&plane->base, prop, 0);
 }
 
-struct drm_plane *exynos_plane_init(struct drm_device *dev,
-				    unsigned long possible_crtcs,
-				    enum drm_plane_type type)
+int exynos_plane_init(struct drm_device *dev,
+		      struct exynos_drm_plane *exynos_plane,
+		      unsigned long possible_crtcs, enum drm_plane_type type)
 {
-	struct exynos_drm_plane *exynos_plane;
 	int err;
 
-	exynos_plane = kzalloc(sizeof(struct exynos_drm_plane), GFP_KERNEL);
-	if (!exynos_plane)
-		return ERR_PTR(-ENOMEM);
-
 	err = drm_universal_plane_init(dev, &exynos_plane->base, possible_crtcs,
 				       &exynos_plane_funcs, formats,
 				       ARRAY_SIZE(formats), type);
 	if (err) {
 		DRM_ERROR("failed to initialize plane\n");
-		kfree(exynos_plane);
-		return ERR_PTR(err);
+		return err;
 	}
 
 	if (type == DRM_PLANE_TYPE_PRIMARY)
@@ -280,5 +270,5 @@ struct drm_plane *exynos_plane_init(struct drm_device *dev,
 	else
 		exynos_plane_attach_zpos_property(&exynos_plane->base);
 
-	return &exynos_plane->base;
+	return 0;
 }
drivers/gpu/drm/exynos/exynos_drm_plane.h +3 -3
index 59d4075..100ca5e 100644
@@ -21,6 +21,6 @@ int exynos_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 			uint32_t src_x, uint32_t src_y,
 			uint32_t src_w, uint32_t src_h);
 void exynos_plane_dpms(struct drm_plane *plane, int mode);
-struct drm_plane *exynos_plane_init(struct drm_device *dev,
-				    unsigned long possible_crtcs,
-				    enum drm_plane_type type);
+int exynos_plane_init(struct drm_device *dev,
+		      struct exynos_drm_plane *exynos_plane,
+		      unsigned long possible_crtcs, enum drm_plane_type type);
drivers/gpu/drm/exynos/exynos_drm_vidi.c +29 -94

201 lines not on this page · raw message

drivers/gpu/drm/exynos/exynos_mixer.c +74 -138

393 lines not on this page · raw message

Signature · 1 line
1.9.3
#18 lore raw

Re: [PATCH 5/6] drm/exynos: remove struct *_win_data abstraction on planes

+Cc Inki,

Hi,

Quoted 42 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

struct {fimd,mixer,vidi}_win_data was just keeping the same data as struct exynos_drm_plane thus get ride of it and use exynos_drm_plane directly.

It changes how planes are created and remove .win_mode_set() callback that was only filling all *_win_data structs.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |   9 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.h  |   1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  14 --
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |   5 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 181 ++++++++++---------------
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  20 +--
 drivers/gpu/drm/exynos/exynos_drm_plane.h |   6 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 123 ++++-------------
 drivers/gpu/drm/exynos/exynos_mixer.c     | 212 +++++++++++-------------------
 9 files changed, 182 insertions(+), 389 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -1
index d0f4e1b..5cd6c1a 100644
@@ -287,13 +287,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)
 }
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
+					       struct drm_plane *plane,
 					       int pipe,
 					       enum exynos_drm_output_type type,
 					       struct exynos_drm_crtc_ops *ops,
 					       void *ctx)
 {
 	struct exynos_drm_crtc *exynos_crtc;
-	struct drm_plane *plane;
 	struct exynos_drm_private *private = drm_dev->dev_private;
 	struct drm_crtc *crtc;
 	int ret;

drivers/gpu/drm/exynos/exynos_drm_crtc.c struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, · line 312

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -6
@@ -309,12 +309,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 	exynos_crtc->type = type;
 	exynos_crtc->ops = ops;
 	exynos_crtc->ctx = ctx;
-	plane = exynos_plane_init(drm_dev, 1 << pipe,
-				  DRM_PLANE_TYPE_PRIMARY);
-	if (IS_ERR(plane)) {
-		ret = PTR_ERR(plane);
-		goto err_plane;
-	}
 

The crtc should have one primary plane, i think it is more reasonable exynos_drm_crtc_create function creates primary plane.

Thanks.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#19 lore raw

Re: [PATCH 5/6] drm/exynos: remove struct *_win_data abstraction on planes

Hi Joonyoung,

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 52 lines

+Cc Inki,

Hi,

Quoted 47 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

struct {fimd,mixer,vidi}_win_data was just keeping the same data as struct exynos_drm_plane thus get ride of it and use exynos_drm_plane directly.

It changes how planes are created and remove .win_mode_set() callback that was only filling all *_win_data structs.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |   9 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.h  |   1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  14 --
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |   5 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 181 ++++++++++---------------
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  20 +--
 drivers/gpu/drm/exynos/exynos_drm_plane.h |   6 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 123 ++++-------------
 drivers/gpu/drm/exynos/exynos_mixer.c     | 212 +++++++++++-------------------
 9 files changed, 182 insertions(+), 389 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -3
index d0f4e1b..5cd6c1a 100644
@@ -287,13 +287,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)
 }
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
+					       struct drm_plane *plane,
 					       int pipe,
 					       enum exynos_drm_output_type type,
 					       struct exynos_drm_crtc_ops *ops,
 					       void *ctx)
 {
 	struct exynos_drm_crtc *exynos_crtc;
-	struct drm_plane *plane;
 	struct exynos_drm_private *private = drm_dev->dev_private;
 	struct drm_crtc *crtc;
 	int ret;
@@ -309,12 +309,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 	exynos_crtc->type = type;
 	exynos_crtc->ops = ops;
 	exynos_crtc->ctx = ctx;
-	plane = exynos_plane_init(drm_dev, 1 << pipe,
-				  DRM_PLANE_TYPE_PRIMARY);
Quoted 8 lines

drivers/gpu/drm/exynos/exynos_drm_crtc.c struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, · line 312

Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -4
-	if (IS_ERR(plane)) {
-		ret = PTR_ERR(plane);
-		goto err_plane;
-	}
 

The crtc should have one primary plane, i think it is more reasonable exynos_drm_crtc_create function creates primary plane.

Yes and it has a primary plane. They are defined in the drivers' struct *_context the same way *_win_data was defined. And they allocated together wit the context struct and and initialized by exynos_plane_init() right before the call to exynos_drm_crtc_create(). Check the fimd_bind() part of this patch for example.

Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#20 lore raw

Re: [PATCH 5/6] drm/exynos: remove struct *_win_data abstraction on planes

Hi,

Quoted 65 lines · Gustavo Padovan

Hi Joonyoung,

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 52 lines

+Cc Inki,

Hi,

Quoted 47 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

struct {fimd,mixer,vidi}_win_data was just keeping the same data as struct exynos_drm_plane thus get ride of it and use exynos_drm_plane directly.

It changes how planes are created and remove .win_mode_set() callback that was only filling all *_win_data structs.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c  |   9 +-
 drivers/gpu/drm/exynos/exynos_drm_crtc.h  |   1 +
 drivers/gpu/drm/exynos/exynos_drm_drv.c   |  14 --
 drivers/gpu/drm/exynos/exynos_drm_drv.h   |   5 +-
 drivers/gpu/drm/exynos/exynos_drm_fimd.c  | 181 ++++++++++---------------
 drivers/gpu/drm/exynos/exynos_drm_plane.c |  20 +--
 drivers/gpu/drm/exynos/exynos_drm_plane.h |   6 +-
 drivers/gpu/drm/exynos/exynos_drm_vidi.c  | 123 ++++-------------
 drivers/gpu/drm/exynos/exynos_mixer.c     | 212 +++++++++++-------------------
 9 files changed, 182 insertions(+), 389 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -3
index d0f4e1b..5cd6c1a 100644
@@ -287,13 +287,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc)
 }
 
 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
+					       struct drm_plane *plane,
 					       int pipe,
 					       enum exynos_drm_output_type type,
 					       struct exynos_drm_crtc_ops *ops,
 					       void *ctx)
 {
 	struct exynos_drm_crtc *exynos_crtc;
-	struct drm_plane *plane;
 	struct exynos_drm_private *private = drm_dev->dev_private;
 	struct drm_crtc *crtc;
 	int ret;
@@ -309,12 +309,6 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev,
 	exynos_crtc->type = type;
 	exynos_crtc->ops = ops;
 	exynos_crtc->ctx = ctx;
-	plane = exynos_plane_init(drm_dev, 1 << pipe,
-				  DRM_PLANE_TYPE_PRIMARY);
Quoted 8 lines

drivers/gpu/drm/exynos/exynos_drm_crtc.c struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, · line 312

Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -4
-	if (IS_ERR(plane)) {
-		ret = PTR_ERR(plane);
-		goto err_plane;
-	}
 

The crtc should have one primary plane, i think it is more reasonable exynos_drm_crtc_create function creates primary plane.

Quoted 6 lines

Yes and it has a primary plane. They are defined in the drivers' struct *_context the same way *_win_data was defined. And they allocated together wit the context struct and and initialized by exynos_plane_init() right before the call to exynos_drm_crtc_create(). Check the fimd_bind() part of this patch for example.

Your approach cannot stop to corrupt primary plane data by overlay plane. We need to separate plane data used by primary plane and plane data used by overlay plane.

Thanks.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#21 lore raw

PATCH 6/6 drm/exynos: do not copy adjusted mode into mode during crtc mode_set

In reply to Gustavo Padovan

From: Daniel Kurtz <[email protected]>

The 'mode' is the modeline information which specifies the ideal mode requested by the mode set initiator (usually userspace). The 'adjusted_mode' is the actual hardware mode after all the crtcs and encoders have had a chance to "fix it up".

The adjusted_mode starts as a duplicate of the mode in drm_crtc_helper_set_mode(), and gets modified as required. There is no reason to touch the original requested mode.

In fact, doing so will cause us to think a new mode is being requested whenever userspace tries to establish a new framebuffer with drmModeSetCrtc(), since userspace will still be using the ideal mode, but the crtc will be incorrectly comparing it against the adjusted_mode.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -6
index 5cd6c1a..7fd6426 100644
@@ -91,12 +91,6 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
 	unsigned int crtc_h;
 	int ret;
 
-	/*
-	 * copy the mode data adjusted by mode_fixup() into crtc->mode
-	 * so that hardware can be seet to proper mode.
-	 */
-	memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));
-
 	ret = exynos_check_plane(crtc->primary, fb);
 	if (ret < 0)
 		return ret;
Signature · 1 line
1.9.3
#22 lore raw

Re: [PATCH 6/6] drm/exynos: do not copy adjusted mode into mode during crtc mode_set

Hi,

Quoted 11 lines · Gustavo Padovan

From: Daniel Kurtz <[email protected]>

The 'mode' is the modeline information which specifies the ideal mode requested by the mode set initiator (usually userspace). The 'adjusted_mode' is the actual hardware mode after all the crtcs and encoders have had a chance to "fix it up".

The adjusted_mode starts as a duplicate of the mode in drm_crtc_helper_set_mode(), and gets modified as required. There is no reason to touch the original requested mode.

Agree, but is there any side effect after this commit? Should we save adjusted_mode to other variable and use it?

Thanks.

Quoted 19 lines

In fact, doing so will cause us to think a new mode is being requested whenever userspace tries to establish a new framebuffer with drmModeSetCrtc(), since userspace will still be using the ideal mode, but the crtc will be incorrectly comparing it against the adjusted_mode.

---
 drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ------
 1 file changed, 6 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -0
index 5cd6c1a..7fd6426 100644
@@ -91,12 +91,6 @@ exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode,
 	unsigned int crtc_h;
 	int ret;

drivers/gpu/drm/exynos/exynos_drm_crtc.c exynos_drm_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mode, · line 96

Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -6
 
-	/*
-	 * copy the mode data adjusted by mode_fixup() into crtc->mode
-	 * so that hardware can be seet to proper mode.
-	 */
-	memcpy(&crtc->mode, adjusted_mode, sizeof(*adjusted_mode));
-
 	ret = exynos_check_plane(crtc->primary, fb);
 	if (ret < 0)
 		return ret;

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#23 lore raw

Re: [PATCH 6/6] drm/exynos: do not copy adjusted mode into mode during crtc mode_set

Hi Joonyoung,

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 10 lines

Hi,

Quoted 7 lines · Gustavo Padovan

From: Daniel Kurtz <[email protected]>

The 'mode' is the modeline information which specifies the ideal mode requested by the mode set initiator (usually userspace). The 'adjusted_mode' is the actual hardware mode after all the crtcs and encoders have had a chance to "fix it up".

Quoted 7 lines
Quoted 4 lines

The adjusted_mode starts as a duplicate of the mode in drm_crtc_helper_set_mode(), and gets modified as required. There is no reason to touch the original requested mode.

Agree, but is there any side effect after this commit? Should we save adjusted_mode to other variable and use it?

I haven't seen any. Tested on peach pi and snow. Do we have any reason to save it now? I don't we have a user for it now.

Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#24 lore raw

Re: [PATCH 6/6] drm/exynos: do not copy adjusted mode into mode during crtc mode_set

Hi,

Quoted 19 lines · Gustavo Padovan

Hi Joonyoung,

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 15 lines

Hi,

Quoted 11 lines · Gustavo Padovan

From: Daniel Kurtz <[email protected]>

The 'mode' is the modeline information which specifies the ideal mode requested by the mode set initiator (usually userspace). The 'adjusted_mode' is the actual hardware mode after all the crtcs and encoders have had a chance to "fix it up".

The adjusted_mode starts as a duplicate of the mode in drm_crtc_helper_set_mode(), and gets modified as required. There is no reason to touch the original requested mode.

Quoted 6 lines
Quoted 2 lines

Agree, but is there any side effect after this commit? Should we save adjusted_mode to other variable and use it?

I haven't seen any. Tested on peach pi and snow. Do we have any reason to save it now? I don't we have a user for it now.

Because current codes use values of adjusted_mode in exynos drm hw drivers.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#25 lore raw

Re: [PATCH 6/6] drm/exynos: do not copy adjusted mode into mode during crtc mode_set

2015-02-02 Joonyoung Shim <[email protected]>:

Quoted 22 lines

Hi,

Quoted 19 lines · Gustavo Padovan

Hi Joonyoung,

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 15 lines

Hi,

Quoted 11 lines · Gustavo Padovan

From: Daniel Kurtz <[email protected]>

The 'mode' is the modeline information which specifies the ideal mode requested by the mode set initiator (usually userspace). The 'adjusted_mode' is the actual hardware mode after all the crtcs and encoders have had a chance to "fix it up".

The adjusted_mode starts as a duplicate of the mode in drm_crtc_helper_set_mode(), and gets modified as required. There is no reason to touch the original requested mode.

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Agree, but is there any side effect after this commit? Should we save adjusted_mode to other variable and use it?

I haven't seen any. Tested on peach pi and snow. Do we have any reason to save it now? I don't we have a user for it now.

Because current codes use values of adjusted_mode in exynos drm hw drivers.

I fail to see where this happen. adjusted_mode is passed to to the mode_set() callback and drivers can use it from there as the hdmi one does for example.

Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#26 lore raw

Re: [PATCH 6/6] drm/exynos: do not copy adjusted mode into mode during crtc mode_set

Hi,

Quoted 27 lines · Gustavo Padovan

2015-02-02 Joonyoung Shim <[email protected]>:

Quoted 25 lines

Hi,

Quoted 22 lines · Gustavo Padovan

Hi Joonyoung,

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 17 lines

Hi,

Quoted 11 lines · Gustavo Padovan

From: Daniel Kurtz <[email protected]>

The 'mode' is the modeline information which specifies the ideal mode requested by the mode set initiator (usually userspace). The 'adjusted_mode' is the actual hardware mode after all the crtcs and encoders have had a chance to "fix it up".

The adjusted_mode starts as a duplicate of the mode in drm_crtc_helper_set_mode(), and gets modified as required. There is no reason to touch the original requested mode.

Agree, but is there any side effect after this commit? Should we save adjusted_mode to other variable and use it?

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

I haven't seen any. Tested on peach pi and snow. Do we have any reason to save it now? I don't we have a user for it now.

Because current codes use values of adjusted_mode in exynos drm hw drivers.

I fail to see where this happen. adjusted_mode is passed to to the mode_set() callback and drivers can use it from there as the hdmi one does for example.

Currently adjusted_mode is copied to &crtc->mode, so after if to use &crtc->mode is same with to use adjusted_mode.

Thanks.

#27 lore raw
In reply to Gustavo Padovan

+Cc Inki,

Hi,

Quoted 5 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

The drm_file event_list hasn't been used anymore by exynos, so we don't need any code to clean it.

No, it is used from drm core e.g. drm_irq.c file.

Thanks.

Quoted 22 lines
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 5 -----
 1 file changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -5
index 25ba362..b60fd9b 100644
@@ -256,11 +256,6 @@ static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
 		}
 	}
 
-	/* Release all events handled by page flip handler but not freed. */
-	list_for_each_entry_safe(e, et, &file->event_list, link) {
-		list_del(&e->link);
-		e->destroy(e);
-	}
 	spin_unlock_irqrestore(&dev->event_lock, flags);
 
 	kfree(file->driver_priv);
#28 lore raw

2015-01-30 Joonyoung Shim <[email protected]>:

Quoted 4 lines

+Cc Inki,

Hi,

Quoted 8 lines
Quoted 5 lines · Gustavo Padovan

From: Gustavo Padovan <[email protected]>

The drm_file event_list hasn't been used anymore by exynos, so we don't need any code to clean it.

No, it is used from drm core e.g. drm_irq.c file.

You are right, I'll drop this patch.

Gustavo