drm/exynos: remove leftover code using event_list
Subsystems (3)
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
@@ -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
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
@@ -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
@@ -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
@@ -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
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
-3drm_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
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
-3drm_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_flipcaller? 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
PATCH 1/1 drm/exynos: track vblank events on a per crtc basis
In reply to Gustavo PadovanFrom: 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
@@ -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
@@ -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
@@ -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
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.
Signed-off-by Mandeep Singh Baines <[email protected]>Signed-off-by Gustavo Padovan <[email protected]>--- 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@@ -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
-15spin_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@@ -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@@ -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.
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.
Signed-off-by Mandeep Singh Baines <[email protected]>Signed-off-by Gustavo Padovan <[email protected]>--- 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@@ -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
-3spin_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
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->eventto do exactly the same asexynos_crtc->pending_flip. So we were losing a event inexynos_drm_crtc_dpms()before too. I change this patch to have apage_fliplist 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
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->eventto do exactly the same asexynos_crtc->pending_flip. So we were losing a event inexynos_drm_crtc_dpms()before too. I change this patch to have apage_fliplist on the crtc.
Quoted 5 lines
The usual approach in other drivers is to return
-EBUSYwhen 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
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->eventto do exactly the same asexynos_crtc->pending_flip. So we were losing a event inexynos_drm_crtc_dpms()before too. I change this patch to have apage_fliplist on the crtc.Quoted 5 lines
The usual approach in other drivers is to return
-EBUSYwhen 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
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->eventto do exactly the same asexynos_crtc->pending_flip. So we were losing a event inexynos_drm_crtc_dpms()before too. I change this patch to have apage_fliplist on the crtc.Quoted 5 lines
The usual approach in other drivers is to return
-EBUSYwhen 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
-EBUSYand send a v2.
Then it's reasonable to me.
Thanks.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/6 drm/exynos: Remove exynos_plane_dpms() call with no effect
In reply to Gustavo PadovanFrom: 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
@@ -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
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 implementwin_enable()- FIMD, Mixer and VIDI. Thus the call toexynos_plane_dpms()is pointless.
No, it needs for pair with DRM_MODE_DPMS_OFF case.
Thanks.
Quoted 11 lines
Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 -- 1 file changed, 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-0
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
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 implementwin_enable()- FIMD, Mixer and VIDI. Thus the call toexynos_plane_dpms()is pointless.No, it needs for pair with
DRM_MODE_DPMS_OFFcase.
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
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 implementwin_enable()- FIMD, Mixer and VIDI. Thus the call toexynos_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_OFFcase.It is a stub call.
exynos_plane_dpms(DRM_MODE_DPMS_ON)only callsexynos_crtc->ops->win_enable()however neither FIMD, VIDI or Mixer implementswin_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.
PATCH 4/6 drm/exynos: remove leftover functions declarations
In reply to Gustavo PadovanFrom: 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
@@ -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
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.
Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 6 ------ 1 file changed, 6 deletions(-)drivers/gpu/drm/exynos/exynos_drm_crtc.h +0
-0@@ -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.
PATCH 5/6 drm/exynos: remove struct *_win_data abstraction on planes
In reply to Gustavo PadovanFrom: 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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
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_planethus get ride of it and useexynos_drm_planedirectly.It changes how planes are created and remove .win_mode_set() callback that was only filling all
*_win_datastructs.Signed-off-by Gustavo Padovan <[email protected]>--- 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@@ -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
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_planethus get ride of it and useexynos_drm_planedirectly.It changes how planes are created and remove .win_mode_set() callback that was only filling all
*_win_datastructs.Signed-off-by Gustavo Padovan <[email protected]>--- 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@@ -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_createfunction 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
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_planethus get ride of it and useexynos_drm_planedirectly.It changes how planes are created and remove .win_mode_set() callback that was only filling all
*_win_datastructs.Signed-off-by Gustavo Padovan <[email protected]>--- 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@@ -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_createfunction creates primary plane.
Quoted 6 lines
Yes and it has a primary plane. They are defined in the drivers' struct
*_contextthe same way*_win_datawas defined. And they allocated together wit the context struct and and initialized byexynos_plane_init()right before the call toexynos_drm_crtc_create(). Check thefimd_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
PATCH 6/6 drm/exynos: do not copy adjusted mode into mode during crtc mode_set
In reply to Gustavo PadovanFrom: 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
@@ -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
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_modestarts as a duplicate of the mode indrm_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 theadjusted_mode.Signed-off-by Daniel Kurtz <[email protected]>Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ------ 1 file changed, 6 deletions(-)drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-0@@ -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
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_modestarts as a duplicate of the mode indrm_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_modeto 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
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_modestarts as a duplicate of the mode indrm_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_modeto 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
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_modestarts as a duplicate of the mode indrm_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_modeto 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_modein 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
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_modestarts as a duplicate of the mode indrm_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_modeto 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_modein exynos drm hw drivers.I fail to see where this happen.
adjusted_modeis passed to to themode_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.
+Cc Inki,
Hi,
Quoted 5 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
The
drm_fileevent_listhasn'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
Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 5 ----- 1 file changed, 5 deletions(-)drivers/gpu/drm/exynos/exynos_drm_drv.c +0
-5@@ -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);
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_fileevent_listhasn'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.cfile.
You are right, I'll drop this patch.
Gustavo