drm/exynos: atomic improvements + exynos_encoder removal
Subsystems (4)
cover drm/exynos: atomic improvements + exynos_encoder removal
From: Gustavo Padovan <[email protected]>
Hi,
This set improves exynos in a number of ways. The first five patches are general clean up/fixes.
Patches 06 to 12 are improvements on top of the newly added atomic modesetting support.
Patches 13-23 are a big journey to completely remove the internal exynos_drm_encoder struct. Now exynos encoders register themselves directly with the drm core.
Please review!
Gustavo
Gustavo Padovan (23):
drm/exynos: pass the correct pipe number
drm/exynos: calculate vrefresh instead of use a fixed value drm/exynos: use KMS version of DRM vblanks functions drm/exynos: remove duplicated check for suspend drm/exynos: Kconfig: select DP if FIMD or DECON are selected drm/exynos: add atomic asynchronous commit
drm/exynos: rename win_commit/disable to atomic-like names drm/exynos: pass struct exynos_drm_plane in update/enable drm/exynos: use drm atomic state directly
drm/exynos: remove unused fields from struct exynos_drm_plane drm/exynos: unify exynos_drm_plane names with drm core drm/exynos: don't track enabled state at exynos_crtc drm/exynos: split display's .dpms() into .enable() and .disable() drm/exynos: remove wrappers for phy_power_{on,off} drm/exynos: remove unused .remove() and .check_mode() ops from display drm/exynos: simplify calculation of possible CRTCs drm/exynos: remove struct exynos_drm_display
drm/exynos: remove extra call to hdmi_commit()
drm/exynos: remove extra call to exynos_dp_commit() drm/exynos: remove exynos_encoder's .commit() op drm/exynos: remove exynos_drm_create_enc_conn() drm/exynos: fold encoder setup into exynos_drm_load() drm/exynos: remove struct exynos_drm_encoder layer
drivers/gpu/drm/exynos/Kconfig | 4 +- drivers/gpu/drm/exynos/Makefile | 7 +- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 86 +++++++------- drivers/gpu/drm/exynos/exynos_dp_core.c | 122 +++++++++---------- drivers/gpu/drm/exynos/exynos_dp_core.h | 3 +- drivers/gpu/drm/exynos/exynos_drm_core.c | 36 ------ drivers/gpu/drm/exynos/exynos_drm_crtc.c | 33 ++---- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 4 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 96 ++++++++------- drivers/gpu/drm/exynos/exynos_drm_drv.c | 19 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 115 +++++------------- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 129 ++++++++++----------- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 174 ---------------------------- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 23 ---- drivers/gpu/drm/exynos/exynos_drm_fb.c | 51 ++++++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 99 +++++++--------- drivers/gpu/drm/exynos/exynos_drm_plane.c | 31 ++--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 107 +++++++++-------- drivers/gpu/drm/exynos/exynos_hdmi.c | 168 +++++++++++++-------------- drivers/gpu/drm/exynos/exynos_mixer.c | 111 +++++++++--------- 20 files changed, 572 insertions(+), 846 deletions(-) delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_encoder.c delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_encoder.h
Signature · 1 line
2.1.0
PATCH 1/23 drm/exynos: pass the correct pipe number
From: Gustavo Padovan <[email protected]>
Instead of giving -1 to as arg to drm_send_vblank_event() pass the correct pipe number to it.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -1
@@ -203,7 +203,7 @@ void exynos_drm_crtc_finish_pageflip(struct drm_device *dev, int pipe)spin_lock_irqsave (&dev->event_lock, flags);if (exynos_crtc->event) { -drm_send_vblank_event (dev,-1 , exynos_crtc->event); +drm_send_vblank_event (dev, pipe, exynos_crtc->event);drm_vblank_put (dev, pipe);wake_up (&exynos_crtc->pending_flip_queue);
Signature · 1 line
2.1.0
PATCH 2/23 drm/exynos: calculate vrefresh instead of use a fixed value
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
When mode's vrefresh is zero we should ask DRM core to calculate vrefresh for us so we can get the correct value instead of relying on fixed value defined in a macro. But if vrefresh is still zero we should fail the update.
--- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_fimd.c +3 -2
@@ -41,7 +41,6 @@* CPU Interface. */ -#define FIMD_DEFAULT_FRAMERATE 60#define MIN_FB_WIDTH_FOR_16WORD_BURST 128/* position control register for hardware window 0, 2 ~ 4.*/
@@ -403,7 +402,9 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, struct drm_display_mode *adjusted_mode) {if (adjusted_mode->vrefresh ==0 ) - adjusted_mode->vrefresh =FIMD_DEFAULT_FRAMERATE ; + adjusted_mode->vrefresh =drm_mode_vrefresh (mode); +if (adjusted_mode->vrefresh ==0 ) +return false;return true; }
Signature · 1 line
2.1.0
Re: [PATCH 02/23] drm/exynos: calculate vrefresh instead of use a fixed value
Quoted 26 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
When mode's vrefresh is zero we should ask DRM core to calculate vrefresh for us so we can get the correct value instead of relying on fixed value defined in a macro. But if vrefresh is still zero we should fail the update.
Suggested-by Daniel Stone <[email protected]>Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fimd.c +0
-1@@ -41,7 +41,6 @@* CPU Interface. */ -#define FIMD_DEFAULT_FRAMERATE 60#define MIN_FB_WIDTH_FOR_16WORD_BURST 128/* position control register for hardware window 0, 2 ~ 4.*/
drivers/gpu/drm/exynos/exynos_drm_fimd.c static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, · line 406
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2
-1@@ -403,7 +402,9 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, struct drm_display_mode *adjusted_mode) {if (adjusted_mode->vrefresh ==0 ) - adjusted_mode->vrefresh =FIMD_DEFAULT_FRAMERATE ; + adjusted_mode->vrefresh =drm_mode_vrefresh (mode); +if (adjusted_mode->vrefresh ==0 )
If adjusted_mode->vrefresh is not 0, it will check two times whether it is 0. Check it in first if statement.
Basically, i'm not sure, why should we check whether adjusted_mode->vrefresh is 0 at first? Can't we use just
adjusted_mode->vrefresh = drm_mode_vrefresh(mode); if (adjusted_mode->vrefresh == 0) ...
without the first checking?
drivers/gpu/drm/exynos/exynos_drm_fimd.c static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, · line 410
Quoted 5 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1
-0+return false;return true; }
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 02/23] drm/exynos: calculate vrefresh instead of use a fixed value
Hi Joonyoung,
2015-07-02 Joonyoung Shim <[email protected]>:
Quoted 37 lines · Gustavo Padovan
Quoted 26 lines
From: Gustavo Padovan <[email protected]>
When mode's vrefresh is zero we should ask DRM core to calculate vrefresh for us so we can get the correct value instead of relying on fixed value defined in a macro. But if vrefresh is still zero we should fail the update.
Suggested-by Daniel Stone <[email protected]>Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/exynos/exynos_drm_fimd.c +0
-1@@ -41,7 +41,6 @@* CPU Interface. */ -#define FIMD_DEFAULT_FRAMERATE 60#define MIN_FB_WIDTH_FOR_16WORD_BURST 128/* position control register for hardware window 0, 2 ~ 4.*/ drivers/gpu/drm/exynos/exynos_drm_fimd.c static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, · line 406
Quoted 6 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2
-1@@ -403,7 +402,9 @@ static bool fimd_mode_fixup(struct exynos_drm_crtc *crtc, struct drm_display_mode *adjusted_mode) {if (adjusted_mode->vrefresh ==0 ) - adjusted_mode->vrefresh =FIMD_DEFAULT_FRAMERATE ; + adjusted_mode->vrefresh =drm_mode_vrefresh (mode); +if (adjusted_mode->vrefresh ==0 )If
adjusted_mode->vrefreshis not 0, it will check two times whether it is 0. Check it in first if statement.
Quoted 8 lines
Basically, i'm not sure, why should we check whether
adjusted_mode->vrefreshis 0 at first? Can't we use justadjusted_mode->vrefresh = drm_mode_vrefresh(mode); if (adjusted_mode->vrefresh == 0) ...without the first checking?
Actually, I don't see why too. I'll remove this and make a second version.
Gustavo
PATCH 3/23 drm/exynos: use KMS version of DRM vblanks functions
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
Get rid of legacy DRM vblank function that are less clear to use. The new ones basically requires only the crtc as parameters.
It also clean ups exynos_drm_crtc_finish_pageflip() parameters as a consequence.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 14 ++++++-------- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++-- drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++-- 6 files changed, 17 insertions(+), 19 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +2 -2
@@ -652,8 +652,8 @@ static irqreturn_t decon_irq_handler(int irq, void *dev_id) goto out;if (!ctx->i80_if) { -drm_handle_vblank (ctx->drm_dev, ctx->pipe); -exynos_drm_crtc_finish_pageflip (ctx->drm_dev, ctx->pipe); +drm_crtc_handle_vblank (&ctx->crtc->base); +exynos_drm_crtc_finish_pageflip (ctx->crtc);/* set wait vsync event to zero and wake up queue. */ if (atomic_read (&ctx->wait_vsync_event)) {
drivers/gpu/drm/exynos/exynos_drm_crtc.c +6 -8
@@ -193,24 +193,22 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe) exynos_crtc->ops->disable_vblank (exynos_crtc); } -void exynos_drm_crtc_finish_pageflip (struct drm_device *dev,int pipe) +void exynos_drm_crtc_finish_pageflip (struct exynos_drm_crtc *exynos_crtc) { -struct exynos_drm_private *dev_priv = dev->dev_private; -struct drm_crtc *drm_crtc = dev_priv->crtc[pipe]; -struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (drm_crtc); +struct drm_crtc *crtc = &exynos_crtc->base;unsigned long flags; -spin_lock_irqsave (&dev->event_lock, flags); +spin_lock_irqsave (&crtc->dev->event_lock, flags);if (exynos_crtc->event) { -drm_send_vblank_event (dev, pipe, exynos_crtc->event); -drm_vblank_put (dev, pipe); +drm_crtc_send_vblank_event (crtc, exynos_crtc->event); +drm_crtc_vblank_put (crtc);wake_up (&exynos_crtc->pending_flip_queue); } exynos_crtc->event =NULL ; -spin_unlock_irqrestore (&dev->event_lock, flags); +spin_unlock_irqrestore (&crtc->dev->event_lock, flags); }void exynos_drm_crtc_complete_scanout (struct drm_framebuffer *fb)
drivers/gpu/drm/exynos/exynos_drm_crtc.h +1 -1
@@ -25,7 +25,7 @@ struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, void *context);int exynos_drm_crtc_enable_vblank (struct drm_device *dev,int pipe);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_finish_pageflip (struct exynos_drm_crtc *exynos_crtc);void exynos_drm_crtc_complete_scanout (struct drm_framebuffer *fb);/* This function gets pipe value to crtc device matched with out_type. */
drivers/gpu/drm/exynos/exynos_drm_fimd.c +4 -4
@@ -886,7 +886,7 @@ static void fimd_te_handler(struct exynos_drm_crtc *crtc) }if (test_bit (0 , &ctx->irq_flags)) -drm_handle_vblank (ctx->drm_dev, ctx->pipe); +drm_crtc_handle_vblank (&ctx->crtc->base); }static void fimd_dp_clock_enable (struct exynos_drm_crtc *crtc,bool enable)
@@ -936,13 +936,13 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) goto out;if (ctx->i80_if) { -exynos_drm_crtc_finish_pageflip (ctx->drm_dev, ctx->pipe); +exynos_drm_crtc_finish_pageflip (ctx->crtc);/* Exits triggering mode */ atomic_set (&ctx->triggering,0 ); }else { -drm_handle_vblank (ctx->drm_dev, ctx->pipe); -exynos_drm_crtc_finish_pageflip (ctx->drm_dev, ctx->pipe); +drm_crtc_handle_vblank (&ctx->crtc->base); +exynos_drm_crtc_finish_pageflip (ctx->crtc);/* set wait vsync event to zero and wake up queue. */ if (atomic_read (&ctx->wait_vsync_event)) {
drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 -2
@@ -196,7 +196,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)mutex_lock (&ctx->lock);if (ctx->direct_vblank) { -drm_handle_vblank (ctx->drm_dev, ctx->pipe); +drm_crtc_handle_vblank (&ctx->crtc->base); ctx->direct_vblank = false;mutex_unlock (&ctx->lock);return ;
@@ -204,7 +204,7 @@ static void vidi_fake_vblank_handler(struct work_struct *work)mutex_unlock (&ctx->lock); -exynos_drm_crtc_finish_pageflip (ctx->drm_dev, ctx->pipe); +exynos_drm_crtc_finish_pageflip (ctx->crtc); } static int vidi_show_connection(struct device *dev,
drivers/gpu/drm/exynos/exynos_mixer.c +2 -2
@@ -731,8 +731,8 @@ static irqreturn_t mixer_irq_handler(int irq, void *arg) goto out; } -drm_handle_vblank (ctx->drm_dev, ctx->pipe); -exynos_drm_crtc_finish_pageflip (ctx->drm_dev, ctx->pipe); +drm_crtc_handle_vblank (&ctx->crtc->base); +exynos_drm_crtc_finish_pageflip (ctx->crtc);/* set wait vsync event to zero and wake up queue. */ if (atomic_read (&ctx->wait_vsync_event)) {
Signature · 1 line
2.1.0
PATCH 4/23 drm/exynos: remove duplicated check for suspend
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
The same check is placed twice in fimd/decon_update_plane(), remove one of them.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 3 --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 3 --- 2 files changed, 6 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +0 -3
@@ -410,9 +410,6 @@ static void decon_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) plane = &ctx->planes[win]; -if (ctx->suspended) -return ; -/* * SHADOWCON/PRTCON register is used for enabling timing. *
drivers/gpu/drm/exynos/exynos_drm_fimd.c +0 -3
@@ -654,9 +654,6 @@ static void fimd_win_commit(struct exynos_drm_crtc *crtc, unsigned int win) plane = &ctx->planes[win]; -if (ctx->suspended) -return ; -/* * SHADOWCON/PRTCON register is used for enabling timing. *
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/23 drm/exynos: Kconfig: select DP if FIMD or DECON are selected
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
DP is required if either FIMD or DECON are selected so select it automatically.
--- drivers/gpu/drm/exynos/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/exynos/Kconfig +3 -1
@@ -20,6 +20,7 @@ config DRM_EXYNOS_FIMD bool "Exynos DRM FIMD" depends on DRM_EXYNOS && !FB_S3C select FB_MODE_HELPERS + select DRM_EXYNOS_DP select MFD_SYSCON help Choose this option if you want to use Exynos FIMD for DRM.
@@ -28,6 +29,7 @@ config DRM_EXYNOS7_DECON bool "Exynos DRM DECON" depends on DRM_EXYNOS && !FB_S3C select FB_MODE_HELPERS + select DRM_EXYNOS_DP help Choose this option if you want to use Exynos DECON for DRM.
@@ -50,7 +52,7 @@ config DRM_EXYNOS_DSI config DRM_EXYNOS_DP bool "EXYNOS DRM DP driver support" - depends on (DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON) && ARCH_EXYNOS && (DRM_PTN3460=n || DRM_PTN3460=y || DRM_PTN3460=DRM_EXYNOS) + depends on ARCH_EXYNOS && (DRM_PTN3460=n || DRM_PTN3460=y || DRM_PTN3460=DRM_EXYNOS) default DRM_EXYNOS select DRM_PANEL help
Signature · 1 line
2.1.0
Re: [PATCH 05/23] drm/exynos: Kconfig: select DP if FIMD or DECON are selected
Hi Gustavo,
Quoted 4 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
DP is required if either FIMD or DECON are selected so select it automatically.
It is not true, there are even SoCs with FIMD/DECON and without DP.
Regards
Andrzej
Quoted 36 lines
Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/Kconfig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpu/drm/exynos/Kconfig +3
-1@@ -20,6 +20,7 @@ config DRM_EXYNOS_FIMD bool "Exynos DRM FIMD" depends on DRM_EXYNOS && !FB_S3C select FB_MODE_HELPERS + select DRM_EXYNOS_DP select MFD_SYSCON help Choose this option if you want to use Exynos FIMD for DRM.@@ -28,6 +29,7 @@ config DRM_EXYNOS7_DECON bool "Exynos DRM DECON" depends on DRM_EXYNOS && !FB_S3C select FB_MODE_HELPERS + select DRM_EXYNOS_DP help Choose this option if you want to use Exynos DECON for DRM.@@ -50,7 +52,7 @@ config DRM_EXYNOS_DSI config DRM_EXYNOS_DP bool "EXYNOS DRM DP driver support" - depends on (DRM_EXYNOS_FIMD || DRM_EXYNOS7_DECON) && ARCH_EXYNOS && (DRM_PTN3460=n || DRM_PTN3460=y || DRM_PTN3460=DRM_EXYNOS) + depends on ARCH_EXYNOS && (DRM_PTN3460=n || DRM_PTN3460=y || DRM_PTN3460=DRM_EXYNOS) default DRM_EXYNOS select DRM_PANEL help
Re: [PATCH 05/23] drm/exynos: Kconfig: select DP if FIMD or DECON are selected
Hi Andrzej,
2015-06-24 Andrzej Hajda <[email protected]>:
Quoted 9 lines
Hi Gustavo,
Quoted 4 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
DP is required if either FIMD or DECON are selected so select it automatically.
It is not true, there are even SoCs with FIMD/DECON and without DP.
Right, I didn't know that. Let's just drop this patch then.
Gustavo
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/23 drm/exynos: add atomic asynchronous commit
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
The atomic modesetting interfaces supports async commits that should be implemented by the drivers. If drm core requests an async commit exynos_atomic_commit() will schedule a work task to run the update later.
It also waits an update to finish before schedule a new one.
--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 6 ++++ drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++++ drivers/gpu/drm/exynos/exynos_drm_fb.c | 51 ++++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 11 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +6 -0
@@ -47,6 +47,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)if (!private)return -ENOMEM ; +INIT_WORK (&private->work, exynos_drm_atomic_work); + private->dev = dev; +dev_set_drvdata (dev->dev, dev); dev->dev_private = (void *)private;
@@ -127,6 +130,8 @@ err_free_private:static int exynos_drm_unload (struct drm_device *dev) { +struct exynos_drm_private *private = dev->dev_private; +exynos_drm_device_subdrv_remove (dev);exynos_drm_fbdev_fini (dev);
@@ -137,6 +142,7 @@ static int exynos_drm_unload(struct drm_device *dev)drm_mode_config_cleanup (dev);drm_release_iommu_mapping (dev); +flush_work (&private->work);kfree (dev->dev_private); dev->dev_private =NULL ;
drivers/gpu/drm/exynos/exynos_drm_drv.h +6 -0
@@ -243,6 +243,10 @@ struct exynos_drm_private {unsigned long da_space_size;unsigned int pipe; + +struct drm_device *dev; +struct work_struct work; +struct drm_atomic_state *state; };/*
@@ -295,6 +299,8 @@ static inline int exynos_dpi_remove(struct exynos_drm_display *display) }#endif +void exynos_drm_atomic_work (struct work_struct *work); +/* This function creates a encoder and a connector, and initializes them. */ int exynos_drm_create_enc_conn (struct drm_device *dev,struct exynos_drm_display *display);
drivers/gpu/drm/exynos/exynos_drm_fb.c +40 -11
66 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 7/23 drm/exynos: rename win_commit/disable to atomic-like names
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
Rename win_commit() helper to update_plane() and win_disable() to disable_plane().
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 10 +++++----- drivers/gpu/drm/exynos/exynos_drm_drv.h | 8 ++++---- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 10 +++++----- drivers/gpu/drm/exynos/exynos_drm_plane.c | 10 +++++----- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 6 +++--- drivers/gpu/drm/exynos/exynos_mixer.c | 10 +++++----- 6 files changed, 27 insertions(+), 27 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +5 -5
@@ -392,7 +392,7 @@ static void decon_shadow_protect_win(struct decon_context *ctx,writel (val, ctx->regs +SHADOWCON ); } -static void decon_win_commit (struct exynos_drm_crtc *crtc,unsigned int win) +static void decon_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct decon_context *ctx = crtc->ctx;struct drm_display_mode *mode = &crtc->base.state->adjusted_mode;
@@ -502,7 +502,7 @@ static void decon_win_commit(struct exynos_drm_crtc *crtc, unsigned int win)writel (val, ctx->regs +DECON_UPDATE ); } -static void decon_win_disable (struct exynos_drm_crtc *crtc,unsigned int win) +static void decon_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct decon_context *ctx = crtc->ctx;struct exynos_drm_plane *plane;
@@ -608,7 +608,7 @@ static void decon_disable(struct exynos_drm_crtc *crtc)* a destroyed buffer later. */ for (i =0 ; i <WINDOWS_NR ; i++) -decon_win_disable (crtc, i); +decon_disable_plane (crtc, i);clk_disable_unprepare (ctx->vclk);clk_disable_unprepare (ctx->eclk);
@@ -628,8 +628,8 @@ static const struct exynos_drm_crtc_ops decon_crtc_ops = { .enable_vblank = decon_enable_vblank, .disable_vblank = decon_disable_vblank, .wait_for_vblank = decon_wait_for_vblank, - .win_commit = decon_win_commit, - .win_disable = decon_win_disable, + .update_plane = decon_update_plane, + .disable_plane = decon_disable_plane, };
drivers/gpu/drm/exynos/exynos_drm_drv.h +4 -4
@@ -153,8 +153,8 @@ 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_commit: apply hardware specific overlay data to registers. -* @win_disable: disable hardware specific overlay. +* @update_plane: apply hardware specific overlay data to registers. +* @disable_plane: disable hardware specific overlay. * @te_handler: trigger to transfer video image at the tearing effect * synchronization signal if there is a page flip request. * @clock_enable: optional function enabling/disabling display domain clock,
@@ -173,8 +173,8 @@ 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_commit)(struct exynos_drm_crtc *crtc,unsigned int zpos); -void (*win_disable)(struct exynos_drm_crtc *crtc,unsigned int zpos); +void (*update_plane)(struct exynos_drm_crtc *crtc,unsigned int zpos); +void (*disable_plane)(struct exynos_drm_crtc *crtc,unsigned int zpos);void (*te_handler)(struct exynos_drm_crtc *crtc);void (*clock_enable)(struct exynos_drm_crtc *crtc,bool enable); };
drivers/gpu/drm/exynos/exynos_drm_fimd.c +5 -5
@@ -638,7 +638,7 @@ static void fimd_shadow_protect_win(struct fimd_context *ctx,writel (val, ctx->regs + reg); } -static void fimd_win_commit (struct exynos_drm_crtc *crtc,unsigned int win) +static void fimd_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct fimd_context *ctx = crtc->ctx;struct exynos_drm_plane *plane;
@@ -746,7 +746,7 @@ static void fimd_win_commit(struct exynos_drm_crtc *crtc, unsigned int win)atomic_set (&ctx->win_updated,1 ); } -static void fimd_win_disable (struct exynos_drm_crtc *crtc,unsigned int win) +static void fimd_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct fimd_context *ctx = crtc->ctx;struct exynos_drm_plane *plane;
@@ -816,7 +816,7 @@ static void fimd_disable(struct exynos_drm_crtc *crtc)* a destroyed buffer later. */ for (i =0 ; i <WINDOWS_NR ; i++) -fimd_win_disable (crtc, i); +fimd_disable_plane (crtc, i);fimd_enable_vblank (crtc);fimd_wait_for_vblank (crtc);
@@ -911,8 +911,8 @@ static const struct exynos_drm_crtc_ops fimd_crtc_ops = { .enable_vblank = fimd_enable_vblank, .disable_vblank = fimd_disable_vblank, .wait_for_vblank = fimd_wait_for_vblank, - .win_commit = fimd_win_commit, - .win_disable = fimd_win_disable, + .update_plane = fimd_update_plane, + .disable_plane = fimd_disable_plane, .te_handler = fimd_te_handler, .clock_enable = fimd_dp_clock_enable, };
drivers/gpu/drm/exynos/exynos_drm_plane.c +5 -5
@@ -179,8 +179,8 @@ static void exynos_plane_atomic_update(struct drm_plane *plane, state->src_x >>16 , state->src_y >>16 , state->src_w >> 16, state->src_h >> 16); -if (exynos_crtc->ops->win_commit) - exynos_crtc->ops->win_commit (exynos_crtc, exynos_plane->zpos); +if (exynos_crtc->ops->update_plane) + exynos_crtc->ops->update_plane (exynos_crtc, exynos_plane->zpos); } static void exynos_plane_atomic_disable(struct drm_plane *plane,
@@ -192,9 +192,9 @@ static void exynos_plane_atomic_disable(struct drm_plane *plane,if (!old_state->crtc)return ; -if (exynos_crtc->ops->win_disable) - exynos_crtc->ops->win_disable (exynos_crtc, - exynos_plane->zpos); +if (exynos_crtc->ops->disable_plane) + exynos_crtc->ops->disable_plane (exynos_crtc, + exynos_plane->zpos); }static const struct drm_plane_helper_funcs plane_helper_funcs = {
drivers/gpu/drm/exynos/exynos_drm_vidi.c +3 -3
@@ -100,7 +100,7 @@ static int vidi_enable_vblank(struct exynos_drm_crtc *crtc)/* * in case of page flip request, vidi_finish_pageflip function * will not be called because direct_vblank is true and then -* that function will be called by crtc_ops->win_commit callback +* that function will be called by crtc_ops->update_plane callback */ schedule_work (&ctx->work);
@@ -118,7 +118,7 @@ static void vidi_disable_vblank(struct exynos_drm_crtc *crtc) ctx->vblank_on = false; } -static void vidi_win_commit (struct exynos_drm_crtc *crtc,unsigned int win) +static void vidi_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct vidi_context *ctx = crtc->ctx;struct exynos_drm_plane *plane;
@@ -179,7 +179,7 @@ static const struct exynos_drm_crtc_ops vidi_crtc_ops = { .disable = vidi_disable, .enable_vblank = vidi_enable_vblank, .disable_vblank = vidi_disable_vblank, - .win_commit = vidi_win_commit, + .update_plane = vidi_update_plane, };static void vidi_fake_vblank_handler (struct work_struct *work)
drivers/gpu/drm/exynos/exynos_mixer.c +5 -5
@@ -920,7 +920,7 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc)mixer_reg_writemask (res,MXR_INT_EN ,0 ,MXR_INT_EN_VSYNC ); } -static void mixer_win_commit (struct exynos_drm_crtc *crtc,unsigned int win) +static void mixer_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct mixer_context *mixer_ctx = crtc->ctx;
@@ -939,7 +939,7 @@ static void mixer_win_commit(struct exynos_drm_crtc *crtc, unsigned int win)mixer_graph_buffer (mixer_ctx, win); } -static void mixer_win_disable (struct exynos_drm_crtc *crtc,unsigned int win) +static void mixer_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) {struct mixer_context *mixer_ctx = crtc->ctx;struct mixer_resources *res = &mixer_ctx->mixer_res;
@@ -1066,7 +1066,7 @@ static void mixer_disable(struct exynos_drm_crtc *crtc)mixer_regs_dump (ctx);for (i =0 ; i <MIXER_WIN_NR ; i++) -mixer_win_disable (crtc, i); +mixer_disable_plane (crtc, i); ctx->int_en =mixer_reg_read (res,MXR_INT_EN );
@@ -1111,8 +1111,8 @@ static const struct exynos_drm_crtc_ops mixer_crtc_ops = { .enable_vblank = mixer_enable_vblank, .disable_vblank = mixer_disable_vblank, .wait_for_vblank = mixer_wait_for_vblank, - .win_commit = mixer_win_commit, - .win_disable = mixer_win_disable, + .update_plane = mixer_update_plane, + .disable_plane = mixer_disable_plane, };static struct mixer_drv_data exynos5420_mxr_drv_data = {
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 8/23 drm/exynos: pass struct exynos_drm_plane in update/enable
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
We already have the plane pointer in before calling .update_plane() or disable_plane() so pass it directly to those calls avoiding a new conversion from zpos to struct exynos_drm_plane.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 22 +++++++--------------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++------------------ drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 9 ++------- drivers/gpu/drm/exynos/exynos_mixer.c | 20 +++++++++++--------- 6 files changed, 33 insertions(+), 53 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +7 -15
@@ -392,24 +392,20 @@ static void decon_shadow_protect_win(struct decon_context *ctx,writel (val, ctx->regs +SHADOWCON ); } -static void decon_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void decon_update_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct decon_context *ctx = crtc->ctx;struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; -struct exynos_drm_plane *plane;int padding;unsigned long val, alpha;unsigned int last_x;unsigned int last_y; +unsigned int win = plane->zpos;if (ctx->suspended)return ; -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; -/* * SHADOWCON/PRTCON register is used for enabling timing. *
@@ -502,17 +498,13 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)writel (val, ctx->regs +DECON_UPDATE ); } -static void decon_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void decon_disable_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct decon_context *ctx = crtc->ctx; -struct exynos_drm_plane *plane; +unsigned int win = plane->zpos;u32 val; -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; -if (ctx->suspended)return ;
@@ -608,7 +600,7 @@ static void decon_disable(struct exynos_drm_crtc *crtc)* a destroyed buffer later. */ for (i =0 ; i <WINDOWS_NR ; i++) -decon_disable_plane (crtc, i); +decon_disable_plane (crtc, &ctx->planes[i]);clk_disable_unprepare (ctx->vclk);clk_disable_unprepare (ctx->eclk);
drivers/gpu/drm/exynos/exynos_drm_drv.h +4 -2
@@ -173,8 +173,10 @@ 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 (*update_plane)(struct exynos_drm_crtc *crtc,unsigned int zpos); -void (*disable_plane)(struct exynos_drm_crtc *crtc,unsigned int zpos); +void (*update_plane)(struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane); +void (*disable_plane)(struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane);void (*te_handler)(struct exynos_drm_crtc *crtc);void (*clock_enable)(struct exynos_drm_crtc *crtc,bool enable); };
drivers/gpu/drm/exynos/exynos_drm_fimd.c +7 -18
@@ -638,21 +638,14 @@ static void fimd_shadow_protect_win(struct fimd_context *ctx,writel (val, ctx->regs + reg); } -static void fimd_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void fimd_update_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct fimd_context *ctx = crtc->ctx; -struct exynos_drm_plane *plane;dma_addr_t dma_addr;unsigned long val, size, offset;unsigned int last_x, last_y, buf_offsize, line_size; - -if (ctx->suspended) -return ; - -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; +unsigned int win = plane->zpos;/* * SHADOWCON/PRTCON register is used for enabling timing.
@@ -746,15 +739,11 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)atomic_set (&ctx->win_updated,1 ); } -static void fimd_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void fimd_disable_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct fimd_context *ctx = crtc->ctx; -struct exynos_drm_plane *plane; - -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; +unsigned int win = plane->zpos;if (ctx->suspended)return ;
@@ -816,7 +805,7 @@ static void fimd_disable(struct exynos_drm_crtc *crtc)* a destroyed buffer later. */ for (i =0 ; i <WINDOWS_NR ; i++) -fimd_disable_plane (crtc, i); +fimd_disable_plane (crtc, &ctx->planes[i]);fimd_enable_vblank (crtc);fimd_wait_for_vblank (crtc);
drivers/gpu/drm/exynos/exynos_drm_plane.c +2 -2
@@ -180,7 +180,7 @@ static void exynos_plane_atomic_update(struct drm_plane *plane, state->src_w >> 16, state->src_h >> 16);if (exynos_crtc->ops->update_plane) - exynos_crtc->ops->update_plane (exynos_crtc, exynos_plane->zpos); + exynos_crtc->ops->update_plane (exynos_crtc, exynos_plane); } static void exynos_plane_atomic_disable(struct drm_plane *plane,
@@ -194,7 +194,7 @@ static void exynos_plane_atomic_disable(struct drm_plane *plane,if (exynos_crtc->ops->disable_plane) exynos_crtc->ops->disable_plane (exynos_crtc, - exynos_plane->zpos); + exynos_plane); }static const struct drm_plane_helper_funcs plane_helper_funcs = {
drivers/gpu/drm/exynos/exynos_drm_vidi.c +2 -7
@@ -118,19 +118,14 @@ static void vidi_disable_vblank(struct exynos_drm_crtc *crtc) ctx->vblank_on = false; } -static void vidi_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void vidi_update_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct vidi_context *ctx = crtc->ctx; -struct exynos_drm_plane *plane;if (ctx->suspended)return ; -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; -DRM_DEBUG_KMS ("dma_addr = %pad\n" , plane->dma_addr);if (ctx->vblank_on)
drivers/gpu/drm/exynos/exynos_mixer.c +11 -9
@@ -920,11 +920,12 @@ static void mixer_disable_vblank(struct exynos_drm_crtc *crtc)mixer_reg_writemask (res,MXR_INT_EN ,0 ,MXR_INT_EN_VSYNC ); } -static void mixer_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void mixer_update_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct mixer_context *mixer_ctx = crtc->ctx; -DRM_DEBUG_KMS ("win: %d\n" , win); +DRM_DEBUG_KMS ("win: %d\n" , plane->zpos);mutex_lock (&mixer_ctx->mixer_mutex);if (!mixer_ctx->powered) {
@@ -933,19 +934,20 @@ static void mixer_update_plane(struct exynos_drm_crtc *crtc, unsigned int win) }mutex_unlock (&mixer_ctx->mixer_mutex); -if (win >1 && mixer_ctx->vp_enabled) -vp_video_buffer (mixer_ctx, win); +if (plane->zpos >1 && mixer_ctx->vp_enabled) +vp_video_buffer (mixer_ctx, plane->zpos);else -mixer_graph_buffer (mixer_ctx, win); +mixer_graph_buffer (mixer_ctx, plane->zpos); } -static void mixer_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void mixer_disable_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct mixer_context *mixer_ctx = crtc->ctx;struct mixer_resources *res = &mixer_ctx->mixer_res;unsigned long flags; -DRM_DEBUG_KMS ("win: %d\n" , win); +DRM_DEBUG_KMS ("win: %d\n" , plane->zpos);mutex_lock (&mixer_ctx->mixer_mutex);if (!mixer_ctx->powered) {
@@ -957,7 +959,7 @@ static void mixer_disable_plane(struct exynos_drm_crtc *crtc, unsigned int win)spin_lock_irqsave (&res->reg_slock, flags);mixer_vsync_set_update (mixer_ctx, false); -mixer_cfg_layer (mixer_ctx, win, false); +mixer_cfg_layer (mixer_ctx, plane->zpos, false);mixer_vsync_set_update (mixer_ctx, true);spin_unlock_irqrestore (&res->reg_slock, flags);
@@ -1066,7 +1068,7 @@ static void mixer_disable(struct exynos_drm_crtc *crtc)mixer_regs_dump (ctx);for (i =0 ; i <MIXER_WIN_NR ; i++) -mixer_disable_plane (crtc, i); +mixer_disable_plane (crtc, &ctx->planes[i]); ctx->int_en =mixer_reg_read (res,MXR_INT_EN );
Signature · 1 line
2.1.0
Re: [PATCH 08/23] drm/exynos: pass struct exynos_drm_plane in update/enable
Quoted 105 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
We already have the plane pointer in before calling .update_plane() or
disable_plane()so pass it directly to those calls avoiding a new conversion from zpos to structexynos_drm_plane.Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 22 +++++++--------------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++------------------ drivers/gpu/drm/exynos/exynos_drm_plane.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 9 ++------- drivers/gpu/drm/exynos/exynos_mixer.c | 20 +++++++++++--------- 6 files changed, 33 insertions(+), 53 deletions(-)drivers/gpu/drm/exynos/exynos7_drm_decon.c +7
-15@@ -392,24 +392,20 @@ static void decon_shadow_protect_win(struct decon_context *ctx,writel (val, ctx->regs +SHADOWCON ); } -static void decon_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void decon_update_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct decon_context *ctx = crtc->ctx;struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; -struct exynos_drm_plane *plane;int padding;unsigned long val, alpha;unsigned int last_x;unsigned int last_y; +unsigned int win = plane->zpos;if (ctx->suspended)return ; -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; -/* * SHADOWCON/PRTCON register is used for enabling timing. * @@ -502,17 +498,13 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, unsigned int win)writel (val, ctx->regs +DECON_UPDATE ); } -static void decon_disable_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void decon_disable_plane (struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane) {struct decon_context *ctx = crtc->ctx; -struct exynos_drm_plane *plane; +unsigned int win = plane->zpos;u32 val; -if (win <0 || win >=WINDOWS_NR ) -return ; - - plane = &ctx->planes[win]; -if (ctx->suspended)return ;@@ -608,7 +600,7 @@ static void decon_disable(struct exynos_drm_crtc *crtc)* a destroyed buffer later. */ for (i =0 ; i <WINDOWS_NR ; i++) -decon_disable_plane (crtc, i); +decon_disable_plane (crtc, &ctx->planes[i]);clk_disable_unprepare (ctx->vclk);clk_disable_unprepare (ctx->eclk);drivers/gpu/drm/exynos/exynos_drm_drv.h +4
-2@@ -173,8 +173,10 @@ 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 (*update_plane)(struct exynos_drm_crtc *crtc,unsigned int zpos); -void (*disable_plane)(struct exynos_drm_crtc *crtc,unsigned int zpos); +void (*update_plane)(struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane); +void (*disable_plane)(struct exynos_drm_crtc *crtc, +struct exynos_drm_plane *plane);void (*te_handler)(struct exynos_drm_crtc *crtc);void (*clock_enable)(struct exynos_drm_crtc *crtc,bool enable); };drivers/gpu/drm/exynos/exynos_drm_fimd.c +1
-1@@ -638,21 +638,14 @@ static void fimd_shadow_protect_win(struct fimd_context *ctx,writel (val, ctx->regs + reg); } -static void fimd_update_plane (struct exynos_drm_crtc *crtc,unsigned int win) +static void fimd_update_plane(struct exynos_drm_crtc *crtc,
drivers/gpu/drm/exynos/exynos_drm_fimd.c static void fimd_shadow_protect_win(struct fimd_context *ctx, · line 650
Quoted 10 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1
-4+ struct exynos_drm_plane *plane) {struct fimd_context *ctx = crtc->ctx; -struct exynos_drm_plane *plane;dma_addr_t dma_addr;unsigned long val, size, offset;unsigned int last_x, last_y, buf_offsize, line_size; - -if (ctx->suspended) -return ;
Don't remove this.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/23 drm/exynos: use drm atomic state directly
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
For some fields the use of struct exynos_drm_plane filled with data from the plane state just creates a source of duplicated information and overhead. Here we change the crtc drivers to access the plane state directly simplifying the code by not relying on a exynos internal struct.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 23 ++++++----- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 29 +++++++------ drivers/gpu/drm/exynos/exynos_drm_plane.c | 12 ------ drivers/gpu/drm/exynos/exynos_mixer.c | 65 ++++++++++++++++-------------- 4 files changed, 63 insertions(+), 66 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +13 -10
@@ -281,16 +281,16 @@ static void decon_disable_vblank(struct exynos_drm_crtc *crtc) } } -static void decon_win_set_pixfmt (struct decon_context *ctx,unsigned int win) +static void decon_win_set_pixfmt (struct decon_context *ctx,unsigned int win, +struct drm_framebuffer *fb) { -struct exynos_drm_plane *plane = &ctx->planes[win];unsigned long val;int padding; val =readl (ctx->regs +WINCON (win)); val &= ~WINCONx_BPPMODE_MASK; -switch (plane->pixel_format) { +switch (fb->pixel_format) {case DRM_FORMAT_RGB565 : val |= WINCONx_BPPMODE_16BPP_565; val |= WINCONx_BURSTLEN_16WORD;
@@ -339,7 +339,7 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win)break ; } -DRM_DEBUG_KMS ("bpp = %d\n" , plane->bpp); +DRM_DEBUG_KMS ("bpp = %d\n" , fb->bits_per_pixel);/* * In case of exynos, setting dma-burst to 16Word causes permanent
@@ -349,8 +349,8 @@ static void decon_win_set_pixfmt(struct decon_context *ctx, unsigned int win)* movement causes unstable DMA which results into iommu crash/tear. */ - padding = (plane->pitch / (plane->bpp >>3 )) - plane->fb_width; -if (plane->fb_width + padding <MIN_FB_WIDTH_FOR_16WORD_BURST ) { + padding = (fb->pitches[0 ] / (fb->bits_per_pixel >>3 )) - fb->width; +if (fb->width + padding <MIN_FB_WIDTH_FOR_16WORD_BURST ) { val &= ~WINCONx_BURSTLEN_MASK; val |= WINCONx_BURSTLEN_8WORD; }
@@ -397,11 +397,14 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, {struct decon_context *ctx = crtc->ctx;struct drm_display_mode *mode = &crtc->base.state->adjusted_mode; +struct drm_plane_state *state = plane->base.state;int padding;unsigned long val, alpha;unsigned int last_x;unsigned int last_y;unsigned int win = plane->zpos; +unsigned int bpp = state->fb->bits_per_pixel >>3 ; +unsigned int pitch = state->fb->pitches[0 ];if (ctx->suspended)return ;
@@ -423,11 +426,11 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc, val = (unsigned long )plane->dma_addr[0 ];writel (val, ctx->regs +VIDW_BUF_START (win)); - padding = (plane->pitch / (plane->bpp >>3 )) - plane->fb_width; + padding = (pitch / bpp) - state->fb->width;/* buffer size */ -writel (plane->fb_width + padding, ctx->regs +VIDW_WHOLE_X (win)); -writel (plane->fb_height, ctx->regs +VIDW_WHOLE_Y (win)); +writel (state->fb->width + padding, ctx->regs +VIDW_WHOLE_X (win)); +writel (state->fb->height, ctx->regs +VIDW_WHOLE_Y (win));/* offset from the start of the buffer to read */ writel (plane->src_x, ctx->regs +VIDW_OFFSET_X (win));
@@ -478,7 +481,7 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,writel (alpha, ctx->regs +VIDOSD_D (win)); -decon_win_set_pixfmt (ctx, win); +decon_win_set_pixfmt (ctx, win, state->fb);/* hardware window 0 doesn't support color key. */ if (win !=0 )
drivers/gpu/drm/exynos/exynos_drm_fimd.c +16 -13
@@ -510,9 +510,9 @@ static void fimd_commit(struct exynos_drm_crtc *crtc) } -static void fimd_win_set_pixfmt (struct fimd_context *ctx,unsigned int win) +static void fimd_win_set_pixfmt (struct fimd_context *ctx,unsigned int win, +struct drm_framebuffer *fb) { -struct exynos_drm_plane *plane = &ctx->planes[win];unsigned long val; val = WINCONx_ENWIN;
@@ -522,11 +522,11 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win)* So the request format is ARGB8888 then change it to XRGB8888. */ if (ctx->driver_data->has_limited_fmt && !win) { -if (plane->pixel_format ==DRM_FORMAT_ARGB8888 ) - plane->pixel_format =DRM_FORMAT_XRGB8888 ; +if (fb->pixel_format ==DRM_FORMAT_ARGB8888 ) + fb->pixel_format =DRM_FORMAT_XRGB8888 ; } -switch (plane->pixel_format) { +switch (fb->pixel_format) {case DRM_FORMAT_C8 : val |=WINCON0_BPPMODE_8BPP_PALETTE ; val |= WINCONx_BURSTLEN_8WORD;
@@ -562,7 +562,7 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win)break ; } -DRM_DEBUG_KMS ("bpp = %d\n" , plane->bpp); +DRM_DEBUG_KMS ("bpp = %d\n" , fb->bits_per_pixel);/* * In case of exynos, setting dma-burst to 16Word causes permanent
@@ -572,7 +572,7 @@ static void fimd_win_set_pixfmt(struct fimd_context *ctx, unsigned int win)* movement causes unstable DMA which results into iommu crash/tear. */ -if (plane->fb_width <MIN_FB_WIDTH_FOR_16WORD_BURST ) { +if (fb->width <MIN_FB_WIDTH_FOR_16WORD_BURST ) { val &= ~WINCONx_BURSTLEN_MASK; val |= WINCONx_BURSTLEN_4WORD; }
@@ -642,10 +642,13 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, struct exynos_drm_plane *plane) {struct fimd_context *ctx = crtc->ctx; +struct drm_plane_state *state = plane->base.state;dma_addr_t dma_addr;unsigned long val, size, offset;unsigned int last_x, last_y, buf_offsize, line_size;unsigned int win = plane->zpos; +unsigned int bpp = state->fb->bits_per_pixel >>3 ; +unsigned int pitch = state->fb->pitches[0 ];/* * SHADOWCON/PRTCON register is used for enabling timing.
@@ -661,8 +664,8 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,fimd_shadow_protect_win (ctx, win, true); - offset = plane->src_x * (plane->bpp >>3 ); - offset += plane->src_y * plane->pitch; + offset = plane->src_x * bpp; + offset += plane->src_y * pitch;/* buffer start address */ dma_addr = plane->dma_addr[0 ] + offset;
@@ -670,7 +673,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,writel (val, ctx->regs +VIDWx_BUF_START (win,0 ));/* buffer end address */ - size = plane->pitch * plane->crtc_height; + size = pitch * plane->crtc_height; val = (unsigned long )(dma_addr + size);writel (val, ctx->regs +VIDWx_BUF_END (win,0 ));
@@ -680,8 +683,8 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc, plane->crtc_width, plane->crtc_height);/* buffer size */ - buf_offsize = plane->pitch - (plane->crtc_width * (plane->bpp >>3 )); - line_size = plane->crtc_width * (plane->bpp >>3 ); + buf_offsize = pitch - (plane->crtc_width * bpp); + line_size = plane->crtc_width * bpp; val =VIDW_BUF_SIZE_OFFSET (buf_offsize) |VIDW_BUF_SIZE_PAGEWIDTH (line_size) | VIDW_BUF_SIZE_OFFSET_E(buf_offsize) |
@@ -721,7 +724,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,DRM_DEBUG_KMS ("osd size = 0x%x\n" , (unsigned int )val); } -fimd_win_set_pixfmt (ctx, win); +fimd_win_set_pixfmt (ctx, win, state->fb);/* hardware window 0 doesn't support color key. */ if (win !=0 )
drivers/gpu/drm/exynos/exynos_drm_plane.c +0 -12
@@ -99,24 +99,12 @@ static void exynos_plane_mode_set(struct drm_plane *plane, exynos_plane->src_y = src_y; exynos_plane->src_width = (actual_w * exynos_plane->h_ratio) >>16 ; exynos_plane->src_height = (actual_h * exynos_plane->v_ratio) >>16 ; - exynos_plane->fb_width = fb->width; - exynos_plane->fb_height = fb->height; - exynos_plane->bpp = fb->bits_per_pixel; - exynos_plane->pitch = fb->pitches[0 ]; - exynos_plane->pixel_format = fb->pixel_format;/* set plane range to be displayed. */ exynos_plane->crtc_x = crtc_x; exynos_plane->crtc_y = crtc_y; exynos_plane->crtc_width = actual_w; exynos_plane->crtc_height = actual_h; - -/* set drm mode data. */ - exynos_plane->mode_width = mode->hdisplay; - exynos_plane->mode_height = mode->vdisplay; - exynos_plane->refresh = mode->vrefresh; - exynos_plane->scan_flag = mode->flags; -DRM_DEBUG_KMS ("plane : offset_x/y(%d,%d), width/height(%d,%d)" , exynos_plane->crtc_x, exynos_plane->crtc_y, exynos_plane->crtc_width, exynos_plane->crtc_height);
drivers/gpu/drm/exynos/exynos_mixer.c +34 -31
156 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 10/23 drm/exynos: remove unused fields from struct exynos_drm_plane
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
Now after the move to use drm_plane_state directly struct drm_plane_state has many unused fields, along with others that weren't used before the plane state change. Thus remove them all.
--- drivers/gpu/drm/exynos/exynos_drm_drv.h | 18 ------------------ 1 file changed, 18 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -18
@@ -46,21 +46,12 @@ enum exynos_drm_output_type {* - the unit is screen coordinates. * @src_width: width of a partial image to be displayed from framebuffer. * @src_height: height of a partial image to be displayed from framebuffer. -* @fb_width: width of a framebuffer. -* @fb_height: height of a framebuffer. * @crtc_x: offset x on hardware screen. * @crtc_y: offset y on hardware screen. * @crtc_width: window width to be displayed (hardware screen). * @crtc_height: window height to be displayed (hardware screen). -* @mode_width: width of screen mode. -* @mode_height: height of screen mode. * @h_ratio: horizontal scaling ratio, 16.16 fixed point * @v_ratio: vertical scaling ratio, 16.16 fixed point -* @refresh: refresh rate. -* @scan_flag: interlace or progressive way. -* (it could be DRM_MODE_FLAG_*) -* @bpp: pixel size.(in bit) -* @pixel_format: fourcc pixel format of this overlay * @dma_addr: array of bus(accessed by dma) address to the memory region * allocated for a overlay. * @zpos: order of overlay layer(z position).
@@ -75,21 +66,12 @@ struct exynos_drm_plane {unsigned int src_y;unsigned int src_width;unsigned int src_height; -unsigned int fb_width; -unsigned int fb_height;unsigned int crtc_x;unsigned int crtc_y;unsigned int crtc_width;unsigned int crtc_height; -unsigned int mode_width; -unsigned int mode_height;unsigned int h_ratio;unsigned int v_ratio; -unsigned int refresh; -unsigned int scan_flag; -unsigned int bpp; -unsigned int pitch; -uint32_t pixel_format;dma_addr_t dma_addr[MAX_FB_BUFFER ];unsigned int zpos; };
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 11/23 drm/exynos: unify exynos_drm_plane names with drm core
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
Rename crtc_{widht,height} to crtc_{w,h} and src_{width,height} to src_{w,h} to make it similar to the atomic state names.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 14 +++++++------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 16 ++++++++-------- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 14 +++++++------- drivers/gpu/drm/exynos/exynos_drm_plane.c | 11 ++++++----- drivers/gpu/drm/exynos/exynos_mixer.c | 22 +++++++++++----------- 5 files changed, 39 insertions(+), 38 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +7 -7
@@ -439,25 +439,25 @@ static void decon_update_plane(struct exynos_drm_crtc *crtc,DRM_DEBUG_KMS ("start addr = 0x%lx\n" , (unsigned long )val);DRM_DEBUG_KMS ("ovl_width = %d, ovl_height = %d\n" , - plane->crtc_width, plane->crtc_height); + plane->crtc_w, plane->crtc_h);/* * OSD position. * In case the window layout goes of LCD layout, DECON fails. */ -if ((plane->crtc_x + plane->crtc_width) > mode->hdisplay) - plane->crtc_x = mode->hdisplay - plane->crtc_width; -if ((plane->crtc_y + plane->crtc_height) > mode->vdisplay) - plane->crtc_y = mode->vdisplay - plane->crtc_height; +if ((plane->crtc_x + plane->crtc_w) > mode->hdisplay) + plane->crtc_x = mode->hdisplay - plane->crtc_w; +if ((plane->crtc_y + plane->crtc_h) > mode->vdisplay) + plane->crtc_y = mode->vdisplay - plane->crtc_h; val =VIDOSDxA_TOPLEFT_X (plane->crtc_x) |VIDOSDxA_TOPLEFT_Y (plane->crtc_y);writel (val, ctx->regs +VIDOSD_A (win)); - last_x = plane->crtc_x + plane->crtc_width; + last_x = plane->crtc_x + plane->crtc_w;if (last_x) last_x--; - last_y = plane->crtc_y + plane->crtc_height; + last_y = plane->crtc_y + plane->crtc_h;if (last_y) last_y--;
drivers/gpu/drm/exynos/exynos_drm_drv.h +8 -8
@@ -44,12 +44,12 @@ enum exynos_drm_output_type {* - the unit is screen coordinates. * @src_y: offset y on a framebuffer to be displayed. * - the unit is screen coordinates. -* @src_width: width of a partial image to be displayed from framebuffer. -* @src_height: height of a partial image to be displayed from framebuffer. +* @src_w: width of a partial image to be displayed from framebuffer. +* @src_h: height of a partial image to be displayed from framebuffer. * @crtc_x: offset x on hardware screen. * @crtc_y: offset y on hardware screen. -* @crtc_width: window width to be displayed (hardware screen). -* @crtc_height: window height to be displayed (hardware screen). +* @crtc_w: window width to be displayed (hardware screen). +* @crtc_h: window height to be displayed (hardware screen). * @h_ratio: horizontal scaling ratio, 16.16 fixed point * @v_ratio: vertical scaling ratio, 16.16 fixed point * @dma_addr: array of bus(accessed by dma) address to the memory region
@@ -64,12 +64,12 @@ struct exynos_drm_plane {struct drm_plane base;unsigned int src_x;unsigned int src_y; -unsigned int src_width; -unsigned int src_height; +unsigned int src_w; +unsigned int src_h;unsigned int crtc_x;unsigned int crtc_y; -unsigned int crtc_width; -unsigned int crtc_height; +unsigned int crtc_w; +unsigned int crtc_h;unsigned int h_ratio;unsigned int v_ratio;dma_addr_t dma_addr[MAX_FB_BUFFER ];
drivers/gpu/drm/exynos/exynos_drm_fimd.c +7 -7
@@ -673,18 +673,18 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,writel (val, ctx->regs +VIDWx_BUF_START (win,0 ));/* buffer end address */ - size = pitch * plane->crtc_height; + size = pitch * plane->crtc_h; val = (unsigned long )(dma_addr + size);writel (val, ctx->regs +VIDWx_BUF_END (win,0 ));DRM_DEBUG_KMS ("start addr = 0x%lx, end addr = 0x%lx, size = 0x%lx\n" , (unsigned long )dma_addr, val, size);DRM_DEBUG_KMS ("ovl_width = %d, ovl_height = %d\n" , - plane->crtc_width, plane->crtc_height); + plane->crtc_w, plane->crtc_h);/* buffer size */ - buf_offsize = pitch - (plane->crtc_width * bpp); - line_size = plane->crtc_width * bpp; + buf_offsize = pitch - (plane->crtc_w * bpp); + line_size = plane->crtc_w * bpp; val =VIDW_BUF_SIZE_OFFSET (buf_offsize) |VIDW_BUF_SIZE_PAGEWIDTH (line_size) | VIDW_BUF_SIZE_OFFSET_E(buf_offsize) |
@@ -698,10 +698,10 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,VIDOSDxA_TOPLEFT_Y_E (plane->crtc_y);writel (val, ctx->regs +VIDOSD_A (win)); - last_x = plane->crtc_x + plane->crtc_width; + last_x = plane->crtc_x + plane->crtc_w;if (last_x) last_x--; - last_y = plane->crtc_y + plane->crtc_height; + last_y = plane->crtc_y + plane->crtc_h;if (last_y) last_y--;
@@ -718,7 +718,7 @@ static void fimd_update_plane(struct exynos_drm_crtc *crtc,u32 offset =VIDOSD_D (win);if (win ==0 ) offset =VIDOSD_C (win); - val = plane->crtc_width * plane->crtc_height; + val = plane->crtc_w * plane->crtc_h;writel (val, ctx->regs + offset);DRM_DEBUG_KMS ("osd size = 0x%x\n" , (unsigned int )val);
drivers/gpu/drm/exynos/exynos_drm_plane.c +6 -5
@@ -97,17 +97,18 @@ static void exynos_plane_mode_set(struct drm_plane *plane,/* set drm framebuffer data. */ exynos_plane->src_x = src_x; exynos_plane->src_y = src_y; - exynos_plane->src_width = (actual_w * exynos_plane->h_ratio) >>16 ; - exynos_plane->src_height = (actual_h * exynos_plane->v_ratio) >>16 ; + exynos_plane->src_w = (actual_w * exynos_plane->h_ratio) >>16 ; + exynos_plane->src_h = (actual_h * exynos_plane->v_ratio) >>16 ;/* set plane range to be displayed. */ exynos_plane->crtc_x = crtc_x; exynos_plane->crtc_y = crtc_y; - exynos_plane->crtc_width = actual_w; - exynos_plane->crtc_height = actual_h; + exynos_plane->crtc_w = actual_w; + exynos_plane->crtc_h = actual_h; +DRM_DEBUG_KMS ("plane : offset_x/y(%d,%d), width/height(%d,%d)" , exynos_plane->crtc_x, exynos_plane->crtc_y, - exynos_plane->crtc_width, exynos_plane->crtc_height); + exynos_plane->crtc_w, exynos_plane->crtc_h); plane->crtc = crtc; }
drivers/gpu/drm/exynos/exynos_mixer.c +11 -11
@@ -443,19 +443,19 @@ static void vp_video_buffer(struct mixer_context *ctx,vp_reg_write (res,VP_IMG_SIZE_C ,VP_IMG_HSIZE (fb->pitches[0 ]) |VP_IMG_VSIZE (fb->height /2 )); -vp_reg_write (res,VP_SRC_WIDTH , plane->src_width); -vp_reg_write (res,VP_SRC_HEIGHT , plane->src_height); +vp_reg_write (res,VP_SRC_WIDTH , plane->src_w); +vp_reg_write (res,VP_SRC_HEIGHT , plane->src_h);vp_reg_write (res,VP_SRC_H_POSITION ,VP_SRC_H_POSITION_VAL (plane->src_x));vp_reg_write (res,VP_SRC_V_POSITION , plane->src_y); -vp_reg_write (res,VP_DST_WIDTH , plane->crtc_width); +vp_reg_write (res,VP_DST_WIDTH , plane->crtc_w);vp_reg_write (res,VP_DST_H_POSITION , plane->crtc_x);if (ctx->interlace) { -vp_reg_write (res,VP_DST_HEIGHT , plane->crtc_height /2 ); +vp_reg_write (res,VP_DST_HEIGHT , plane->crtc_h /2 );vp_reg_write (res,VP_DST_V_POSITION , plane->crtc_y /2 ); }else { -vp_reg_write (res,VP_DST_HEIGHT , plane->crtc_height); +vp_reg_write (res,VP_DST_HEIGHT , plane->crtc_h);vp_reg_write (res,VP_DST_V_POSITION , plane->crtc_y); }
@@ -492,15 +492,15 @@ static void mixer_layer_update(struct mixer_context *ctx)static int mixer_setup_scale (const struct exynos_drm_plane *plane,unsigned int *x_ratio,unsigned int *y_ratio) { -if (plane->crtc_width != plane->src_width) { -if (plane->crtc_width ==2 * plane->src_width) +if (plane->crtc_w != plane->src_w) { +if (plane->crtc_w ==2 * plane->src_w) *x_ratio =1 ;else goto fail; } -if (plane->crtc_height != plane->src_height) { -if (plane->crtc_height ==2 * plane->src_height) +if (plane->crtc_h != plane->src_h) { +if (plane->crtc_h ==2 * plane->src_h) *y_ratio =1 ;else goto fail;
@@ -589,8 +589,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx,mixer_reg_write (res,MXR_RESOLUTION , val); } - val =MXR_GRP_WH_WIDTH (plane->src_width); - val |=MXR_GRP_WH_HEIGHT (plane->src_height); + val =MXR_GRP_WH_WIDTH (plane->src_w); + val |=MXR_GRP_WH_HEIGHT (plane->src_h); val |=MXR_GRP_WH_H_SCALE (x_ratio); val |=MXR_GRP_WH_V_SCALE (y_ratio);mixer_reg_write (res,MXR_GRAPHIC_WH (win), val);
Signature · 1 line
2.1.0
PATCH 12/23 drm/exynos: don't track enabled state at exynos_crtc
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
struct drm_crtc already stores the enabled state of the crtc thus we don't need to replicate enabled in exynos_drm_crtc.
--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 16 ---------------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 - 2 files changed, 17 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -16
@@ -26,14 +26,9 @@ static void exynos_drm_crtc_enable(struct drm_crtc *crtc) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -if (exynos_crtc->enabled) -return ; -if (exynos_crtc->ops->enable) exynos_crtc->ops->enable (exynos_crtc); - exynos_crtc->enabled = true; -drm_crtc_vblank_on (crtc); }
@@ -41,9 +36,6 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -if (!exynos_crtc->enabled) -return ; -/* wait for the completion of page flip. */ if (!wait_event_timeout (exynos_crtc->pending_flip_queue, (exynos_crtc->event ==NULL ),HZ /20 ))
@@ -53,8 +45,6 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc)if (exynos_crtc->ops->disable) exynos_crtc->ops->disable (exynos_crtc); - - exynos_crtc->enabled = false; } static bool
@@ -171,9 +161,6 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe)struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (private->crtc[pipe]); -if (!exynos_crtc->enabled) -return -EPERM ; -if (exynos_crtc->ops->enable_vblank) exynos_crtc->ops->enable_vblank (exynos_crtc);
@@ -186,9 +173,6 @@ void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe)struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (private->crtc[pipe]); -if (!exynos_crtc->enabled) -return ; -if (exynos_crtc->ops->disable_vblank) exynos_crtc->ops->disable_vblank (exynos_crtc); }
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -1
@@ -184,7 +184,6 @@ struct exynos_drm_crtc {struct drm_crtc base;enum exynos_drm_output_type type;unsigned int pipe; -bool enabled;wait_queue_head_t pending_flip_queue;struct drm_pending_vblank_event *event;const struct exynos_drm_crtc_ops *ops;
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 12/23] drm/exynos: don't track enabled state at exynos_crtc
Quoted 50 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
struct
drm_crtcalready stores the enabled state of the crtc thus we don't need to replicate enabled inexynos_drm_crtc.Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 16 ---------------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 - 2 files changed, 17 deletions(-)drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-10@@ -26,14 +26,9 @@ static void exynos_drm_crtc_enable(struct drm_crtc *crtc) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -if (exynos_crtc->enabled) -return ; -if (exynos_crtc->ops->enable) exynos_crtc->ops->enable (exynos_crtc); - exynos_crtc->enabled = true; -drm_crtc_vblank_on (crtc); }@@ -41,9 +36,6 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc) {struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (crtc); -if (!exynos_crtc->enabled) -return ; -/* wait for the completion of page flip. */ if (!wait_event_timeout (exynos_crtc->pending_flip_queue, (exynos_crtc->event ==NULL ),HZ /20 ))@@ -53,8 +45,6 @@ static void exynos_drm_crtc_disable(struct drm_crtc *crtc)if (exynos_crtc->ops->disable) exynos_crtc->ops->disable (exynos_crtc); - - exynos_crtc->enabled = false; } static bool
drivers/gpu/drm/exynos/exynos_drm_crtc.c int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe) · line 165
Quoted 8 lines
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0
-3@@ -171,9 +161,6 @@ int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe)struct exynos_drm_crtc *exynos_crtc =to_exynos_crtc (private->crtc[pipe]); -if (!exynos_crtc->enabled) -return -EPERM ; -if (exynos_crtc->ops->enable_vblank) exynos_crtc->ops->enable_vblank (exynos_crtc);
Before apply this patch, we should check return value of exynos_crtc->ops->enable_vblank() and return it.
_______________________________________________
dri-devel mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 13/23 drm/exynos: split display's .dpms() into .enable() and .disable()
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
The DRM Core doesn't have a dpms() operation anymore, everything now is enable() or disable().
--- drivers/gpu/drm/exynos/exynos_dp_core.c | 37 ++++------------ drivers/gpu/drm/exynos/exynos_drm_dpi.c | 36 ++++------------ drivers/gpu/drm/exynos/exynos_drm_drv.h | 6 ++- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 44 ++++++------------- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 8 ++-- drivers/gpu/drm/exynos/exynos_hdmi.c | 65 ++++++++++------------------- 6 files changed, 62 insertions(+), 134 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +9 -28
@@ -1067,8 +1067,9 @@ static void exynos_dp_phy_exit(struct exynos_dp_device *dp)phy_power_off (dp->phy); } -static void exynos_dp_poweron (struct exynos_dp_device *dp) +static void exynos_dp_enable (struct exynos_drm_display *display) { +struct exynos_dp_device *dp =display_to_dp (display);struct exynos_drm_crtc *crtc =dp_to_crtc (dp);if (dp->dpms_mode ==DRM_MODE_DPMS_ON )
@@ -1091,13 +1092,11 @@ static void exynos_dp_poweron(struct exynos_dp_device *dp)exynos_dp_commit (&dp->display); } -static void exynos_dp_poweroff (struct exynos_dp_device *dp) +static void exynos_dp_disable (struct exynos_drm_display *display) { +struct exynos_dp_device *dp =display_to_dp (display);struct exynos_drm_crtc *crtc =dp_to_crtc (dp); -if (dp->dpms_mode !=DRM_MODE_DPMS_ON ) -return ; -if (dp->panel) {if (drm_panel_disable (dp->panel)) {DRM_ERROR ("failed to disable the panel\n" );
@@ -1119,28 +1118,10 @@ static void exynos_dp_poweroff(struct exynos_dp_device *dp) } } -static void exynos_dp_dpms (struct exynos_drm_display *display,int mode) -{ -struct exynos_dp_device *dp =display_to_dp (display); - -switch (mode) { -case DRM_MODE_DPMS_ON : -exynos_dp_poweron (dp); -break ; -case DRM_MODE_DPMS_STANDBY : -case DRM_MODE_DPMS_SUSPEND : -case DRM_MODE_DPMS_OFF : -exynos_dp_poweroff (dp); -break ; -default : -break ; - } - dp->dpms_mode = mode; -} -static struct exynos_drm_display_ops exynos_dp_display_ops = { .create_connector = exynos_dp_create_connector, - .dpms = exynos_dp_dpms, + .enable = exynos_dp_enable, + .disable = exynos_dp_disable, .commit = exynos_dp_commit, };
@@ -1320,7 +1301,7 @@ static void exynos_dp_unbind(struct device *dev, struct device *master, {struct exynos_dp_device *dp =dev_get_drvdata (dev); -exynos_dp_dpms (&dp->display,DRM_MODE_DPMS_OFF ); +exynos_dp_disable (&dp->display); }static const struct component_ops exynos_dp_ops = {
@@ -1378,7 +1359,7 @@ static int exynos_dp_suspend(struct device *dev) {struct exynos_dp_device *dp =dev_get_drvdata (dev); -exynos_dp_dpms (&dp->display,DRM_MODE_DPMS_OFF ); +exynos_dp_disable (&dp->display);return 0 ; }
@@ -1386,7 +1367,7 @@ static int exynos_dp_resume(struct device *dev) {struct exynos_dp_device *dp =dev_get_drvdata (dev); -exynos_dp_dpms (&dp->display,DRM_MODE_DPMS_ON ); +exynos_dp_enable (&dp->display);return 0 ; }#endif
drivers/gpu/drm/exynos/exynos_drm_dpi.c +9 -27
@@ -32,7 +32,6 @@ struct exynos_dpi {struct drm_encoder *encoder;struct videomode *vm; -int dpms_mode; };#define connector_to_dpi (c) container_of(c, struct exynos_dpi, connector)
@@ -133,46 +132,30 @@ static int exynos_dpi_create_connector(struct exynos_drm_display *display,return 0 ; } -static void exynos_dpi_poweron (struct exynos_dpi *ctx) +static void exynos_dpi_enable (struct exynos_drm_display *display) { +struct exynos_dpi *ctx =display_to_dpi (display); +if (ctx->panel) {drm_panel_prepare (ctx->panel);drm_panel_enable (ctx->panel); } } -static void exynos_dpi_poweroff (struct exynos_dpi *ctx) +static void exynos_dpi_disable (struct exynos_drm_display *display) { +struct exynos_dpi *ctx =display_to_dpi (display); +if (ctx->panel) {drm_panel_disable (ctx->panel);drm_panel_unprepare (ctx->panel); } } -static void exynos_dpi_dpms (struct exynos_drm_display *display,int mode) -{ -struct exynos_dpi *ctx =display_to_dpi (display); - -switch (mode) { -case DRM_MODE_DPMS_ON : -if (ctx->dpms_mode !=DRM_MODE_DPMS_ON ) -exynos_dpi_poweron (ctx); -break ; -case DRM_MODE_DPMS_STANDBY : -case DRM_MODE_DPMS_SUSPEND : -case DRM_MODE_DPMS_OFF : -if (ctx->dpms_mode ==DRM_MODE_DPMS_ON ) -exynos_dpi_poweroff (ctx); -break ; -default : -break ; - } - ctx->dpms_mode = mode; -} -static struct exynos_drm_display_ops exynos_dpi_display_ops = { .create_connector = exynos_dpi_create_connector, - .dpms = exynos_dpi_dpms + .enable = exynos_dpi_enable, + .disable = exynos_dpi_disable, };/* of_* functions will be removed after merge of of_graph patches */
@@ -311,7 +294,6 @@ struct exynos_drm_display *exynos_dpi_probe(struct device *dev) ctx->display.type =EXYNOS_DISPLAY_TYPE_LCD ; ctx->display.ops = &exynos_dpi_display_ops; ctx->dev = dev; - ctx->dpms_mode =DRM_MODE_DPMS_OFF ; ret =exynos_dpi_parse_dt (ctx);if (ret <0 ) {
@@ -332,7 +314,7 @@ int exynos_dpi_remove(struct exynos_drm_display *display) {struct exynos_dpi *ctx =display_to_dpi (display); -exynos_dpi_dpms (&ctx->display,DRM_MODE_DPMS_OFF ); +exynos_dpi_disable (&ctx->display);if (ctx->panel)drm_panel_detach (ctx->panel);
drivers/gpu/drm/exynos/exynos_drm_drv.h +4 -2
@@ -86,7 +86,8 @@ struct exynos_drm_plane {* @mode_set: convert drm_display_mode to hw specific display mode and * would be called by encoder->mode_set(). * @check_mode: check if mode is valid or not. -* @dpms: display device on or off. +* @enable: display device on. +* @disable: display device off. * @commit: apply changes to hw */ struct exynos_drm_display ;
@@ -102,7 +103,8 @@ struct exynos_drm_display_ops { struct drm_display_mode *mode);int (*check_mode)(struct exynos_drm_display *display,struct drm_display_mode *mode); -void (*dpms)(struct exynos_drm_display *display,int mode); +void (*enable)(struct exynos_drm_display *display); +void (*disable)(struct exynos_drm_display *display);void (*commit)(struct exynos_drm_display *display); };
drivers/gpu/drm/exynos/exynos_drm_dsi.c +13 -31
99 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_encoder.c +4 -4
@@ -70,8 +70,8 @@ static void exynos_drm_encoder_enable(struct drm_encoder *encoder)struct exynos_drm_encoder *exynos_encoder =to_exynos_encoder (encoder);struct exynos_drm_display *display = exynos_encoder->display; -if (display->ops->dpms) - display->ops->dpms (display,DRM_MODE_DPMS_ON ); +if (display->ops->enable) + display->ops->enable (display);if (display->ops->commit) display->ops->commit (display);
@@ -82,8 +82,8 @@ static void exynos_drm_encoder_disable(struct drm_encoder *encoder)struct exynos_drm_encoder *exynos_encoder =to_exynos_encoder (encoder);struct exynos_drm_display *display = exynos_encoder->display; -if (display->ops->dpms) - display->ops->dpms (display,DRM_MODE_DPMS_OFF ); +if (display->ops->disable) + display->ops->disable (display); }static struct drm_encoder_helper_funcs exynos_encoder_helper_funcs = {
drivers/gpu/drm/exynos/exynos_hdmi.c +23 -42
98 lines not on this page · raw message
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 14/23 drm/exynos: remove wrappers for phy_power_{on,off}
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
phy_power_on() and phy_power_off() already checks for NULL pointer. This patch removes the wrappers exynos_dp_phy_init() and exynos_dp_phy_exit() since the only think they were doing was a check for NULL phy.
--- drivers/gpu/drm/exynos/exynos_dp_core.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +3 -15
@@ -1055,18 +1055,6 @@ static int exynos_dp_create_connector(struct exynos_drm_display *display,return ret; } -static void exynos_dp_phy_init (struct exynos_dp_device *dp) -{ -if (dp->phy) -phy_power_on (dp->phy); -} - -static void exynos_dp_phy_exit (struct exynos_dp_device *dp) -{ -if (dp->phy) -phy_power_off (dp->phy); -} -static void exynos_dp_enable (struct exynos_drm_display *display) {struct exynos_dp_device *dp =display_to_dp (display);
@@ -1086,7 +1074,7 @@ static void exynos_dp_enable(struct exynos_drm_display *display) crtc->ops->clock_enable (dp_to_crtc (dp), true);clk_prepare_enable (dp->clock); -exynos_dp_phy_init (dp); +phy_power_on (dp->phy);exynos_dp_init_dp (dp);enable_irq (dp->irq);exynos_dp_commit (&dp->display);
@@ -1106,7 +1094,7 @@ static void exynos_dp_disable(struct exynos_drm_display *display)disable_irq (dp->irq);flush_work (&dp->hotplug_work); -exynos_dp_phy_exit (dp); +phy_power_off (dp->phy);clk_disable_unprepare (dp->clock);if (crtc->ops->clock_enable)
@@ -1279,7 +1267,7 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)INIT_WORK (&dp->hotplug_work, exynos_dp_hotplug); -exynos_dp_phy_init (dp); +phy_power_on (dp->phy);exynos_dp_init_dp (dp);
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 15/23 drm/exynos: remove unused .remove() and .check_mode() ops from display
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
These two display_ops are not used anywhere, remove them.
--- drivers/gpu/drm/exynos/exynos_drm_drv.h | 5 ----- 1 file changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -5
@@ -81,11 +81,9 @@ struct exynos_drm_plane {* - this structure is common to analog tv, digital tv and lcd panel. * * @create_connector: initialize and register a new connector -* @remove: cleans up the display for removal * @mode_fixup: fix mode data comparing to hw specific display mode. * @mode_set: convert drm_display_mode to hw specific display mode and * would be called by encoder->mode_set(). -* @check_mode: check if mode is valid or not. * @enable: display device on. * @disable: display device off. * @commit: apply changes to hw
@@ -94,15 +92,12 @@ struct exynos_drm_display;struct exynos_drm_display_ops {int (*create_connector)(struct exynos_drm_display *display,struct drm_encoder *encoder); -void (*remove)(struct exynos_drm_display *display);void (*mode_fixup)(struct exynos_drm_display *display,struct drm_connector *connector,const struct drm_display_mode *mode,struct drm_display_mode *adjusted_mode);void (*mode_set)(struct exynos_drm_display *display,struct drm_display_mode *mode); -int (*check_mode)(struct exynos_drm_display *display, -struct drm_display_mode *mode);void (*enable)(struct exynos_drm_display *display);void (*disable)(struct exynos_drm_display *display);void (*commit)(struct exynos_drm_display *display);
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 16/23 drm/exynos: simplify calculation of possible CRTCs
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
All CRTCs can only be LCD, HDMI or VIDI, so basically all CRTCs will be a possible CRTCs. This patch removes an extra function with switch that was only checking if the CRTC type was one of those three above.
--- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_encoder.c +5 -24
@@ -105,36 +105,17 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { .destroy = exynos_drm_encoder_destroy, }; -static unsigned int exynos_drm_encoder_clones (struct drm_encoder *encoder) +void exynos_drm_encoder_setup (struct drm_device *dev) { -struct drm_encoder *clone; -struct drm_device *dev = encoder->dev; -struct exynos_drm_encoder *exynos_encoder =to_exynos_encoder (encoder); -struct exynos_drm_display *display = exynos_encoder->display; +struct drm_encoder *encoder;unsigned int clone_mask =0 ;int cnt =0 ; -list_for_each_entry (clone, &dev->mode_config.encoder_list, head) { -switch (display->type) { -case EXYNOS_DISPLAY_TYPE_LCD : -case EXYNOS_DISPLAY_TYPE_HDMI : -case EXYNOS_DISPLAY_TYPE_VIDI : - clone_mask |= (1 << (cnt++)); -break ; -default : -continue ; - } - } - -return clone_mask; -} - -void exynos_drm_encoder_setup (struct drm_device *dev) -{ -struct drm_encoder *encoder; +list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) + clone_mask |= (1 << (cnt++));list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) - encoder->possible_clones =exynos_drm_encoder_clones (encoder); + encoder->possible_clones = clone_mask; } struct drm_encoder *
Signature · 1 line
2.1.0
PATCH 17/23 drm/exynos: remove struct exynos_drm_display
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
This struct was just representing encoder information, it was a member of struct exynos_drm_encoder, so any code trying to access encoder data would have to go through the encoder struct, get the display struct and then get the data it want.
During this patchset we also realized that the only data exynos_drm_encoder needs to store is the drm_encoder parent and the exynos_drm_encoder_ops.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 17 ++++--- drivers/gpu/drm/exynos/exynos_dp_core.c | 46 +++++++++--------- drivers/gpu/drm/exynos/exynos_dp_core.h | 3 +- drivers/gpu/drm/exynos/exynos_drm_core.c | 23 ++++----- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 41 ++++++++-------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 47 ++++++++---------- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 57 +++++++++++----------- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 75 ++++++++--------------------- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 6 +-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 18 +++---- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 43 +++++------------ drivers/gpu/drm/exynos/exynos_hdmi.c | 47 +++++++++--------- 14 files changed, 176 insertions(+), 251 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +9 -8
@@ -61,7 +61,7 @@ struct decon_context {atomic_t wait_vsync_event;struct exynos_drm_panel_info panel; -struct exynos_drm_display *display; +struct exynos_drm_encoder *encoder; };static const struct of_device_id decon_driver_dt_match[] = {
@@ -690,8 +690,9 @@ static int decon_bind(struct device *dev, struct device *master, void *data)return PTR_ERR (ctx->crtc); } -if (ctx->display) -exynos_drm_create_enc_conn (drm_dev, ctx->display); +if (ctx->encoder) +exynos_drm_create_enc_conn (drm_dev, ctx->encoder, +EXYNOS_DISPLAY_TYPE_LCD );return 0 ;
@@ -704,8 +705,8 @@ static void decon_unbind(struct device *dev, struct device *master,decon_disable (ctx->crtc); -if (ctx->display) -exynos_dpi_remove (ctx->display); +if (ctx->encoder) +exynos_dpi_remove (ctx->encoder);decon_ctx_remove (ctx); }
@@ -790,9 +791,9 @@ static int decon_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ctx); - ctx->display =exynos_dpi_probe (dev); -if (IS_ERR (ctx->display)) { - ret =PTR_ERR (ctx->display); + ctx->encoder =exynos_dpi_probe (dev); +if (IS_ERR (ctx->encoder)) { + ret =PTR_ERR (ctx->encoder); goto err_iounmap; }
drivers/gpu/drm/exynos/exynos_dp_core.c +22 -24
130 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_dp_core.h +1 -2
@@ -147,11 +147,10 @@ struct link_train { };struct exynos_dp_device { -struct exynos_drm_display display; +struct exynos_drm_encoder encoder;struct device *dev;struct drm_device *drm_dev;struct drm_connector connector; -struct drm_encoder *encoder;struct drm_panel *panel;struct drm_bridge *bridge;struct clk *clock;
drivers/gpu/drm/exynos/exynos_drm_core.c +9 -14
@@ -21,38 +21,33 @@static LIST_HEAD (exynos_drm_subdrv_list);int exynos_drm_create_enc_conn (struct drm_device *dev, -struct exynos_drm_display *display) +struct exynos_drm_encoder *exynos_encoder, +enum exynos_drm_output_type type) { -struct drm_encoder *encoder;int ret;unsigned long possible_crtcs =0 ; - ret =exynos_drm_crtc_get_pipe_from_type (dev, display->type); + ret =exynos_drm_crtc_get_pipe_from_type (dev, type);if (ret <0 )return ret; possible_crtcs |=1 << ret;/* create and initialize a encoder for this sub driver. */ - encoder =exynos_drm_encoder_create (dev, display, possible_crtcs); -if (!encoder) { + ret =exynos_drm_encoder_create (dev, exynos_encoder, possible_crtcs); +if (ret) {DRM_ERROR ("failed to create encoder\n" ); -return -EFAULT ; +return ret; } - display->encoder = encoder; - - ret = display->ops->create_connector (display, encoder); + ret = exynos_encoder->ops->create_connector (exynos_encoder);if (ret) {DRM_ERROR ("failed to create connector ret = %d\n" , ret); - goto err_destroy_encoder; +drm_encoder_cleanup (&exynos_encoder->base); +return ret; }return 0 ; - -err_destroy_encoder: - encoder->funcs->destroy (encoder); -return ret; }int exynos_drm_subdrv_register (struct exynos_drm_subdrv *subdrv)
drivers/gpu/drm/exynos/exynos_drm_crtc.c +1 -1
@@ -219,7 +219,7 @@ void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb) }int exynos_drm_crtc_get_pipe_from_type (struct drm_device *drm_dev, -unsigned int out_type) +enum exynos_drm_output_type out_type) {struct drm_crtc *crtc;
drivers/gpu/drm/exynos/exynos_drm_crtc.h +1 -1
@@ -30,7 +30,7 @@ void exynos_drm_crtc_complete_scanout(struct drm_framebuffer *fb);/* 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); +enum exynos_drm_output_type out_type);/* * This function calls the crtc device(manager)'s te_handler() callback
drivers/gpu/drm/exynos/exynos_drm_dpi.c +19 -22
117 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_drv.h +21 -26
90 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_dsi.c +29 -28
154 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_encoder.c +19 -56
135 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_encoder.h +2 -4
@@ -15,9 +15,7 @@#define _EXYNOS_DRM_ENCODER_H_void exynos_drm_encoder_setup (struct drm_device *dev); -struct drm_encoder *exynos_drm_encoder_create (struct drm_device *dev, -struct exynos_drm_display *mgr, -unsigned long possible_crtcs); -struct exynos_drm_display *exynos_drm_get_display (struct drm_encoder *encoder); +int exynos_drm_encoder_create (struct drm_device *dev,struct exynos_drm_encoder + *encoder,unsigned long possible_crtcs);#endif
drivers/gpu/drm/exynos/exynos_drm_fimd.c +9 -9
@@ -168,7 +168,7 @@ struct fimd_context {struct exynos_drm_panel_info panel;struct fimd_driver_data *driver_data; -struct exynos_drm_display *display; +struct exynos_drm_encoder *encoder; };static const struct of_device_id fimd_driver_dt_match[] = {
@@ -973,8 +973,9 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)if (IS_ERR (ctx->crtc))return PTR_ERR (ctx->crtc); -if (ctx->display) -exynos_drm_create_enc_conn (drm_dev, ctx->display); +if (ctx->encoder) +exynos_drm_create_enc_conn (drm_dev, ctx->encoder, +EXYNOS_DISPLAY_TYPE_LCD );return fimd_iommu_attach_devices (ctx, drm_dev); }
@@ -988,8 +989,8 @@ static void fimd_unbind(struct device *dev, struct device *master,fimd_iommu_detach_devices (ctx); -if (ctx->display) -exynos_dpi_remove (ctx->display); +if (ctx->encoder) +exynos_dpi_remove (ctx->encoder); }static const struct component_ops fimd_component_ops = {
@@ -1096,10 +1097,9 @@ static int fimd_probe(struct platform_device *pdev)platform_set_drvdata (pdev, ctx); - ctx->display =exynos_dpi_probe (dev); -if (IS_ERR (ctx->display)) { -return PTR_ERR (ctx->display); - } + ctx->encoder =exynos_dpi_probe (dev); +if (IS_ERR (ctx->encoder)) +return PTR_ERR (ctx->encoder);pm_runtime_enable (dev);
drivers/gpu/drm/exynos/exynos_drm_vidi.c +12 -31
105 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_hdmi.c +22 -25
139 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH 18/23 drm/exynos: remove extra call to hdmi_commit()
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
hdmi_commit() was getting called twice by exynos encoder core, once inside the .enable() call and another time by .commit() itself.
--- drivers/gpu/drm/exynos/exynos_hdmi.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-)
drivers/gpu/drm/exynos/exynos_hdmi.c +1 -16
@@ -2019,20 +2019,6 @@ static void hdmi_mode_set(struct exynos_drm_encoder *encoder,hdmi_v14_mode_set (hdata, mode); } -static void hdmi_commit (struct exynos_drm_encoder *encoder) -{ -struct hdmi_context *hdata =encoder_to_hdmi (encoder); - -mutex_lock (&hdata->hdmi_mutex); -if (!hdata->powered) { -mutex_unlock (&hdata->hdmi_mutex); -return ; - } -mutex_unlock (&hdata->hdmi_mutex); - -hdmi_conf_apply (hdata); -} -static void hdmi_enable (struct exynos_drm_encoder *encoder) {struct hdmi_context *hdata =encoder_to_hdmi (encoder);
@@ -2061,7 +2047,7 @@ static void hdmi_enable(struct exynos_drm_encoder *encoder)clk_prepare_enable (res->sclk_hdmi);hdmiphy_poweron (hdata); -hdmi_commit (encoder); +hdmi_conf_apply (hdata); }static void hdmi_disable (struct exynos_drm_encoder *encoder)
@@ -2121,7 +2107,6 @@ static struct exynos_drm_encoder_ops hdmi_encoder_ops = { .mode_set = hdmi_mode_set, .enable = hdmi_enable, .disable = hdmi_disable, - .commit = hdmi_commit, };static void hdmi_hotplug_work_func (struct work_struct *work)
Signature · 1 line
2.1.0
PATCH 19/23 drm/exynos: remove extra call to exynos_dp_commit()
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
exynos_dp_commit() was getting called twice by exynos encoder core, once inside the .enable() call and another time by .commit() itself.
The remove of the second call caused the wake of a bug, the operations orders inside exynos_dp_commit was wrong and we had to move exynos_dp_start_video() to be the last operation in there.
--- drivers/gpu/drm/exynos/exynos_dp_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos_dp_core.c +3 -4
@@ -796,9 +796,6 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp)/* Configure video slave mode */ exynos_dp_enable_video_master (dp,0 ); -/* Enable video */ -exynos_dp_start_video (dp); - timeout_loop =0 ;for (;;) {
@@ -939,6 +936,9 @@ static void exynos_dp_commit(struct exynos_drm_encoder *encoder)if (drm_panel_enable (dp->panel))DRM_ERROR ("failed to enable the panel\n" ); } + +/* Enable video */ +exynos_dp_start_video (dp); } static enum drm_connector_status exynos_dp_detect(
@@ -1108,7 +1108,6 @@ static struct exynos_drm_encoder_ops exynos_dp_encoder_ops = { .create_connector = exynos_dp_create_connector, .enable = exynos_dp_enable, .disable = exynos_dp_disable, - .commit = exynos_dp_commit, };static struct video_info *exynos_dp_dt_parse_pdata (struct device *dev)
Signature · 1 line
2.1.0
Re: [PATCH 19/23] drm/exynos: remove extra call to exynos_dp_commit()
+Cc Hyungwon,
Quoted 9 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
exynos_dp_commit()was getting called twice by exynos encoder core, once inside the .enable() call and another time by .commit() itself.The remove of the second call caused the wake of a bug, the operations orders inside
exynos_dp_commitwas wrong and we had to moveexynos_dp_start_video()to be the last operation in there.
Hyungwon, can you check this?
Quoted 31 lines
Signed-off-by Gustavo Padovan <[email protected]>--- drivers/gpu/drm/exynos/exynos_dp_core.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/gpu/drm/exynos/exynos_dp_core.c +3
-3@@ -796,9 +796,6 @@ static int exynos_dp_config_video(struct exynos_dp_device *dp)/* Configure video slave mode */ exynos_dp_enable_video_master (dp,0 ); -/* Enable video */ -exynos_dp_start_video (dp); - timeout_loop =0 ;for (;;) {@@ -939,6 +936,9 @@ static void exynos_dp_commit(struct exynos_drm_encoder *encoder)if (drm_panel_enable (dp->panel))DRM_ERROR ("failed to enable the panel\n" ); } + +/* Enable video */ +exynos_dp_start_video (dp); } static enum drm_connector_status exynos_dp_detect(
drivers/gpu/drm/exynos/exynos_dp_core.c static struct exynos_drm_encoder_ops exynos_dp_encoder_ops = { · line 1113
Quoted 7 lines
drivers/gpu/drm/exynos/exynos_dp_core.c +0
-1@@ -1108,7 +1108,6 @@ static struct exynos_drm_encoder_ops exynos_dp_encoder_ops = { .create_connector = exynos_dp_create_connector, .enable = exynos_dp_enable, .disable = exynos_dp_disable, - .commit = exynos_dp_commit, };static struct video_info *exynos_dp_dt_parse_pdata (struct device *dev)
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 19/23] drm/exynos: remove extra call to exynos_dp_commit()
Hi Hyungwon,
Quoted 8 lines · Joonyoung Shim
+Cc Hyungwon,
Quoted 5 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
exynos_dp_commit()was getting called twice by exynos encoder core, once inside the .enable() call and another time by .commit() itself.
Quoted 7 lines
Quoted 4 lines
The remove of the second call caused the wake of a bug, the operations orders inside
exynos_dp_commitwas wrong and we had to moveexynos_dp_start_video()to be the last operation in there.Hyungwon, can you check this?
I confused that this is about dsi and you involved in exynos dsi driver lately, so i requested.
Sorry for that.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 20/23 drm/exynos: remove exynos_encoder's .commit() op
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
.commit() is not used anymore, Exynos encoders now follow the .enable()/.disable() semantics from drm atomic core, so remove this callback.
--- drivers/gpu/drm/exynos/exynos_drm_drv.h | 2 -- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 3 --- 2 files changed, 5 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.h +0 -2
@@ -87,7 +87,6 @@ struct exynos_drm_plane {* would be called by encoder->mode_set(). * @enable: display device on. * @disable: display device off. -* @commit: apply changes to hw */ struct exynos_drm_encoder ;struct exynos_drm_encoder_ops {
@@ -100,7 +99,6 @@ struct exynos_drm_encoder_ops { struct drm_display_mode *mode);void (*enable)(struct exynos_drm_encoder *encoder);void (*disable)(struct exynos_drm_encoder *encoder); -void (*commit)(struct exynos_drm_encoder *encoder); };/*
drivers/gpu/drm/exynos/exynos_drm_encoder.c +0 -3
@@ -56,9 +56,6 @@ static void exynos_drm_encoder_enable(struct drm_encoder *encoder)if (exynos_encoder->ops->enable) exynos_encoder->ops->enable (exynos_encoder); - -if (exynos_encoder->ops->commit) - exynos_encoder->ops->commit (exynos_encoder); }static void exynos_drm_encoder_disable (struct drm_encoder *encoder)
Signature · 1 line
2.1.0
PATCH 21/23 drm/exynos: remove exynos_drm_create_enc_conn()
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
This functions was just hiding the encoder and connector creation in a way that was less clean than if we get rid of it. For example, exynos_encoder ops had .create_connector() defined only because we were handing off the encoder and connector creation to exynos_drm_create_enc_conn(). Without this function we can directly call the create_connector function internally in the code, without the need of any vtable access.
It also does some refactoring in the code like creating a bind function for dpi devices.
--- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 3 +-- drivers/gpu/drm/exynos/exynos_dp_core.c | 20 ++++++++++++++++--- drivers/gpu/drm/exynos/exynos_drm_core.c | 30 ----------------------------- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 26 +++++++++++++++++++++++-- drivers/gpu/drm/exynos/exynos_drm_drv.h | 13 ++++++------- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 20 ++++++++++++------- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 11 +++++++---- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 4 +++- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 3 +-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 20 ++++++++++--------- drivers/gpu/drm/exynos/exynos_hdmi.c | 21 +++++++++++++++++--- 11 files changed, 101 insertions(+), 70 deletions(-)
drivers/gpu/drm/exynos/exynos7_drm_decon.c +1 -2
@@ -691,8 +691,7 @@ static int decon_bind(struct device *dev, struct device *master, void *data) }if (ctx->encoder) -exynos_drm_create_enc_conn (drm_dev, ctx->encoder, -EXYNOS_DISPLAY_TYPE_LCD ); +exynos_dpi_bind (drm_dev, ctx->encoder);return 0 ;
drivers/gpu/drm/exynos/exynos_dp_core.c +17 -3
@@ -33,6 +33,7 @@#include <drm/bridge/ptn3460.h> #include "exynos_dp_core.h" +#include "exynos_drm_encoder.h" #define ctx_from_connector (c) container_of(c, struct exynos_dp_device, \ connector)
@@ -1105,7 +1106,6 @@ static void exynos_dp_disable(struct exynos_drm_encoder *encoder) }static struct exynos_drm_encoder_ops exynos_dp_encoder_ops = { - .create_connector = exynos_dp_create_connector, .enable = exynos_dp_enable, .disable = exynos_dp_disable, };
@@ -1186,6 +1186,7 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data)struct exynos_dp_device *dp =dev_get_drvdata (dev);struct platform_device *pdev =to_platform_device (dev);struct drm_device *drm_dev = data; +struct exynos_drm_encoder *exynos_encoder = &dp->encoder;struct resource *res;unsigned int irq_flags;int ret =0 ;
@@ -1278,8 +1279,21 @@ static int exynos_dp_bind(struct device *dev, struct device *master, void *data) dp->drm_dev = drm_dev; -return exynos_drm_create_enc_conn (drm_dev, &dp->encoder, -EXYNOS_DISPLAY_TYPE_LCD ); + ret =exynos_drm_encoder_create (drm_dev, exynos_encoder, +EXYNOS_DISPLAY_TYPE_LCD ); +if (ret) { +DRM_ERROR ("failed to create encoder\n" ); +return ret; + } + + ret =exynos_dp_create_connector (exynos_encoder); +if (ret) { +DRM_ERROR ("failed to create connector ret = %d\n" , ret); +drm_encoder_cleanup (&exynos_encoder->base); +return ret; + } + +return 0 ; } static void exynos_dp_unbind(struct device *dev, struct device *master,
drivers/gpu/drm/exynos/exynos_drm_core.c +0 -30
@@ -20,36 +20,6 @@static LIST_HEAD (exynos_drm_subdrv_list); -int exynos_drm_create_enc_conn (struct drm_device *dev, -struct exynos_drm_encoder *exynos_encoder, -enum exynos_drm_output_type type) -{ -int ret; -unsigned long possible_crtcs =0 ; - - ret =exynos_drm_crtc_get_pipe_from_type (dev, type); -if (ret <0 ) -return ret; - - possible_crtcs |=1 << ret; - -/* create and initialize a encoder for this sub driver. */ - ret =exynos_drm_encoder_create (dev, exynos_encoder, possible_crtcs); -if (ret) { -DRM_ERROR ("failed to create encoder\n" ); -return ret; - } - - ret = exynos_encoder->ops->create_connector (exynos_encoder); -if (ret) { -DRM_ERROR ("failed to create connector ret = %d\n" , ret); -drm_encoder_cleanup (&exynos_encoder->base); -return ret; - } - -return 0 ; -} -int exynos_drm_subdrv_register (struct exynos_drm_subdrv *subdrv) {if (!subdrv)
drivers/gpu/drm/exynos/exynos_drm_dpi.c +24 -2
@@ -20,7 +20,8 @@#include <video/of_videomode.h> #include <video/videomode.h> -#include "exynos_drm_drv.h" +#include "exynos_drm_encoder.h" +#include "exynos_drm_crtc.h" struct exynos_dpi {struct exynos_drm_encoder encoder;
@@ -151,7 +152,6 @@ static void exynos_dpi_disable(struct exynos_drm_encoder *encoder) }static struct exynos_drm_encoder_ops exynos_dpi_encoder_ops = { - .create_connector = exynos_dpi_create_connector, .enable = exynos_dpi_enable, .disable = exynos_dpi_disable, };
@@ -280,6 +280,28 @@ static int exynos_dpi_parse_dt(struct exynos_dpi *ctx)return 0 ; } +int exynos_dpi_bind (struct drm_device *dev, +struct exynos_drm_encoder *exynos_encoder) +{ +int ret; + + ret =exynos_drm_encoder_create (dev, exynos_encoder, +EXYNOS_DISPLAY_TYPE_LCD ); +if (ret) { +DRM_ERROR ("failed to create encoder\n" ); +return ret; + } + + ret =exynos_dpi_create_connector (exynos_encoder); +if (ret) { +DRM_ERROR ("failed to create connector ret = %d\n" , ret); +drm_encoder_cleanup (&exynos_encoder->base); +return ret; + } + +return 0 ; +} +struct exynos_drm_encoder *exynos_dpi_probe (struct device *dev) {struct exynos_dpi *ctx;
drivers/gpu/drm/exynos/exynos_drm_drv.h +6 -7
@@ -81,7 +81,6 @@ struct exynos_drm_plane {* Exynos DRM Encoder Structure. * - this structure is common to analog tv, digital tv and lcd panel. * -* @create_connector: initialize and register a new connector * @mode_fixup: fix mode data comparing to hw specific display mode. * @mode_set: convert drm_display_mode to hw specific display mode and * would be called by encoder->mode_set().
@@ -90,7 +89,6 @@ struct exynos_drm_plane {*/ struct exynos_drm_encoder ;struct exynos_drm_encoder_ops { -int (*create_connector)(struct exynos_drm_encoder *encoder); void (*mode_fixup)(struct exynos_drm_encoder *encoder, struct drm_connector *connector, const struct drm_display_mode *mode,
@@ -262,6 +260,7 @@ void exynos_drm_subdrv_close(struct drm_device *dev, struct drm_file *file);#ifdef CONFIG_DRM_EXYNOS_DPI struct exynos_drm_encoder *exynos_dpi_probe (struct device *dev);int exynos_dpi_remove (struct exynos_drm_encoder *encoder); +int exynos_dpi_bind (struct drm_device *dev,struct exynos_drm_encoder *encoder);#else static inline struct exynos_drm_encoder *exynos_dpi_probe (struct device *dev) {return NULL ; }
@@ -269,15 +268,15 @@ static inline int exynos_dpi_remove(struct exynos_drm_encoder *encoder) {return 0 ; } +static inline int exynos_dpi_bind (struct drm_device *dev, +struct exynos_drm_encoder *encoder) +{ +return 0 ; +}#endif void exynos_drm_atomic_work (struct work_struct *work); -/* This function creates a encoder and a connector, and initializes them. */ -int exynos_drm_create_enc_conn (struct drm_device *dev, -struct exynos_drm_encoder *encoder, -enum exynos_drm_output_type type); -extern struct platform_driver fimd_driver;extern struct platform_driver decon_driver;extern struct platform_driver dp_driver;
drivers/gpu/drm/exynos/exynos_drm_dsi.c +13 -7
@@ -29,6 +29,7 @@#include <video/videomode.h> #include "exynos_drm_crtc.h" +#include "exynos_drm_encoder.h" #include "exynos_drm_drv.h" /* returns true iff both arguments logically differs */
@@ -1523,7 +1524,6 @@ static void exynos_dsi_mode_set(struct exynos_drm_encoder *encoder, }static struct exynos_drm_encoder_ops exynos_dsi_encoder_ops = { - .create_connector = exynos_dsi_create_connector, .mode_set = exynos_dsi_mode_set, .enable = exynos_dsi_enable, .disable = exynos_dsi_disable,
@@ -1634,16 +1634,22 @@ end:static int exynos_dsi_bind (struct device *dev,struct device *master,void *data) { -struct exynos_drm_encoder *encoder =dev_get_drvdata (dev); -struct exynos_dsi *dsi =encoder_to_dsi (encoder); +struct exynos_drm_encoder *exynos_encoder =dev_get_drvdata (dev); +struct exynos_dsi *dsi =encoder_to_dsi (exynos_encoder);struct drm_device *drm_dev = data;int ret; - ret =exynos_drm_create_enc_conn (drm_dev, encoder, -EXYNOS_DISPLAY_TYPE_LCD ); + ret =exynos_drm_encoder_create (drm_dev, exynos_encoder, +EXYNOS_DISPLAY_TYPE_LCD ); +if (ret) { +DRM_ERROR ("failed to create encoder\n" ); +return ret; + } + + ret =exynos_dsi_create_connector (exynos_encoder);if (ret) { -DRM_ERROR ("Encoder create [%d] failed with %d\n" , -EXYNOS_DISPLAY_TYPE_LCD , ret); +DRM_ERROR ("failed to create connector ret = %d\n" , ret); +drm_encoder_cleanup (&exynos_encoder->base);return ret; }
drivers/gpu/drm/exynos/exynos_drm_encoder.c +7 -4
@@ -17,6 +17,7 @@#include "exynos_drm_drv.h" #include "exynos_drm_encoder.h" +#include "exynos_drm_crtc.h" static bool exynos_drm_encoder_mode_fixup(struct drm_encoder *encoder,
@@ -92,15 +93,17 @@ void exynos_drm_encoder_setup(struct drm_device *dev)int exynos_drm_encoder_create (struct drm_device *dev,struct exynos_drm_encoder *exynos_encoder, -unsigned long possible_crtcs) +enum exynos_drm_output_type type) {struct drm_encoder *encoder; +int pipe; -if (!possible_crtcs) -return -EINVAL ; + pipe =exynos_drm_crtc_get_pipe_from_type (dev, type); +if (pipe <0 ) +return pipe; encoder = &exynos_encoder->base; - encoder->possible_crtcs = possible_crtcs; + encoder->possible_crtcs =1 << pipe;DRM_DEBUG_KMS ("possible_crtcs = 0x%x\n" , encoder->possible_crtcs);
drivers/gpu/drm/exynos/exynos_drm_encoder.h +3 -1
@@ -14,8 +14,10 @@#ifndef _EXYNOS_DRM_ENCODER_H_#define _EXYNOS_DRM_ENCODER_H_ +#include "exynos_drm_drv.h" +void exynos_drm_encoder_setup (struct drm_device *dev);int exynos_drm_encoder_create (struct drm_device *dev,struct exynos_drm_encoder - *encoder,unsigned long possible_crtcs); + *encoder,enum exynos_drm_output_type type);#endif
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -2
@@ -974,8 +974,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data)return PTR_ERR (ctx->crtc);if (ctx->encoder) -exynos_drm_create_enc_conn (drm_dev, ctx->encoder, -EXYNOS_DISPLAY_TYPE_LCD ); +exynos_dpi_bind (drm_dev, ctx->encoder);return fimd_iommu_attach_devices (ctx, drm_dev); }
drivers/gpu/drm/exynos/exynos_drm_vidi.c +11 -9
@@ -389,15 +389,11 @@ static int vidi_create_connector(struct exynos_drm_encoder *exynos_encoder)return 0 ; } - -static struct exynos_drm_encoder_ops vidi_encoder_ops = { - .create_connector = vidi_create_connector, -}; -static int vidi_bind (struct device *dev,struct device *master,void *data) {struct vidi_context *ctx =dev_get_drvdata (dev);struct drm_device *drm_dev = data; +struct exynos_drm_encoder *exynos_encoder = &ctx->encoder;struct exynos_drm_plane *exynos_plane;enum drm_plane_type type;unsigned int zpos;
@@ -423,10 +419,17 @@ static int vidi_bind(struct device *dev, struct device *master, void *data)return PTR_ERR (ctx->crtc); } - ret =exynos_drm_create_enc_conn (drm_dev, &ctx->encoder, -EXYNOS_DISPLAY_TYPE_VIDI ); + ret =exynos_drm_encoder_create (drm_dev, exynos_encoder, +EXYNOS_DISPLAY_TYPE_VIDI ); +if (ret) { +DRM_ERROR ("failed to create encoder\n" ); +return ret; + } + + ret =vidi_create_connector (exynos_encoder);if (ret) { - ctx->crtc->base.funcs->destroy (&ctx->crtc->base); +DRM_ERROR ("failed to create connector ret = %d\n" , ret); +drm_encoder_cleanup (&exynos_encoder->base);return ret; }
@@ -452,7 +455,6 @@ static int vidi_probe(struct platform_device *pdev)if (!ctx)return -ENOMEM ; - ctx->encoder.ops = &vidi_encoder_ops; ctx->default_win =0 ; ctx->pdev = pdev;
drivers/gpu/drm/exynos/exynos_hdmi.c +18 -3
@@ -45,6 +45,7 @@#include "exynos_drm_drv.h" #include "exynos_drm_crtc.h" +#include "exynos_drm_encoder.h" #include "exynos_mixer.h" #include <linux/gpio.h>
@@ -2102,7 +2103,6 @@ out: }static struct exynos_drm_encoder_ops hdmi_encoder_ops = { - .create_connector = hdmi_create_connector, .mode_fixup = hdmi_mode_fixup, .mode_set = hdmi_mode_set, .enable = hdmi_enable,
@@ -2264,11 +2264,26 @@ static int hdmi_bind(struct device *dev, struct device *master, void *data) {struct drm_device *drm_dev = data;struct hdmi_context *hdata =dev_get_drvdata (dev); +struct exynos_drm_encoder *exynos_encoder = &hdata->encoder; +int ret; hdata->drm_dev = drm_dev; -return exynos_drm_create_enc_conn (drm_dev, &hdata->encoder, -EXYNOS_DISPLAY_TYPE_HDMI ); + ret =exynos_drm_encoder_create (drm_dev, exynos_encoder, +EXYNOS_DISPLAY_TYPE_HDMI ); +if (ret) { +DRM_ERROR ("failed to create encoder\n" ); +return ret; + } + +hdmi_create_connector (exynos_encoder); +if (ret) { +DRM_ERROR ("failed to create connector ret = %d\n" , ret); +drm_encoder_cleanup (&exynos_encoder->base); +return ret; + } + +return 0 ; }static void hdmi_unbind (struct device *dev,struct device *master,void *data)
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 22/23 drm/exynos: fold encoder setup into exynos_drm_load()
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
As we are removing the exynos encoder move the encoder setup operation directly inside the exynos_drm_load()
--- drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 ++++++++++-- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 13 ------------- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 1 - 3 files changed, 10 insertions(+), 16 deletions(-)
drivers/gpu/drm/exynos/exynos_drm_drv.c +10 -2
@@ -41,7 +41,9 @@static int exynos_drm_load (struct drm_device *dev,unsigned long flags) {struct exynos_drm_private *private; -int ret; +struct drm_encoder *encoder; +unsigned int clone_mask; +int cnt, ret; private =kzalloc (sizeof (struct exynos_drm_private ),GFP_KERNEL );if (!private)
@@ -70,7 +72,13 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)exynos_drm_mode_config_init (dev);/* setup possible_clones. */ -exynos_drm_encoder_setup (dev); + cnt =0 ; + clone_mask =0 ; +list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) + clone_mask |= (1 << (cnt++)); + +list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) + encoder->possible_clones = clone_mask;platform_set_drvdata (dev->platformdev, dev);
drivers/gpu/drm/exynos/exynos_drm_encoder.c +0 -13
@@ -78,19 +78,6 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { .destroy = drm_encoder_cleanup, }; -void exynos_drm_encoder_setup (struct drm_device *dev) -{ -struct drm_encoder *encoder; -unsigned int clone_mask =0 ; -int cnt =0 ; - -list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) - clone_mask |= (1 << (cnt++)); - -list_for_each_entry (encoder, &dev->mode_config.encoder_list, head) - encoder->possible_clones = clone_mask; -} -int exynos_drm_encoder_create (struct drm_device *dev,struct exynos_drm_encoder *exynos_encoder,enum exynos_drm_output_type type)
drivers/gpu/drm/exynos/exynos_drm_encoder.h +0 -1
@@ -16,7 +16,6 @@#include "exynos_drm_drv.h" -void exynos_drm_encoder_setup (struct drm_device *dev);int exynos_drm_encoder_create (struct drm_device *dev,struct exynos_drm_encoder *encoder,enum exynos_drm_output_type type);
Signature · 6 lines
2.1.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 23/23 drm/exynos: remove struct exynos_drm_encoder layer
In reply to Gustavo PadovanFrom: Gustavo Padovan <[email protected]>
struct exynos_drm_encoder was justing wrapping struct drm_encoder, it had only a drm_encoder member and the internal exynos_drm_encoders ops that was directly mapped to the drm_encoder helper funcs.
So now exynos DRM uses struct drm_encoder directly, this removes completely the struct exynos_drm_encoder.
--- drivers/gpu/drm/exynos/Makefile | 7 +- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 2 +- drivers/gpu/drm/exynos/exynos_dp_core.c | 68 ++++++++++++------ drivers/gpu/drm/exynos/exynos_dp_core.h | 2 +- drivers/gpu/drm/exynos/exynos_drm_core.c | 1 - drivers/gpu/drm/exynos/exynos_drm_crtc.c | 1 - drivers/gpu/drm/exynos/exynos_drm_dpi.c | 51 ++++++++------ drivers/gpu/drm/exynos/exynos_drm_drv.c | 1 - drivers/gpu/drm/exynos/exynos_drm_drv.h | 47 ++----------- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 80 +++++++++++---------- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 105 ---------------------------- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 22 ------ drivers/gpu/drm/exynos/exynos_drm_fimd.c | 2 +- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 71 ++++++++++++++----- drivers/gpu/drm/exynos/exynos_hdmi.c | 90 ++++++++++++++---------- 15 files changed, 238 insertions(+), 312 deletions(-) delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_encoder.c delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_encoder.h
drivers/gpu/drm/exynos/Makefile +3 -4
@@ -3,10 +3,9 @@ # Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher. ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/exynos -exynosdrm-y := exynos_drm_drv.o exynos_drm_encoder.o \ - exynos_drm_crtc.o exynos_drm_fbdev.o exynos_drm_fb.o \ - exynos_drm_buf.o exynos_drm_gem.o exynos_drm_core.o \ - exynos_drm_plane.o exynos_drm_dmabuf.o +exynosdrm-y := exynos_drm_drv.o exynos_drm_crtc.o exynos_drm_fbdev.o \ + exynos_drm_fb.o exynos_drm_buf.o exynos_drm_gem.o \ + exynos_drm_core.o exynos_drm_plane.o exynos_drm_dmabuf.o exynosdrm-$(CONFIG_DRM_EXYNOS_IOMMU) += exynos_drm_iommu.o exynosdrm-$(CONFIG_DRM_EXYNOS_FIMD) += exynos_drm_fimd.o
drivers/gpu/drm/exynos/exynos7_drm_decon.c +1 -1
@@ -61,7 +61,7 @@ struct decon_context {atomic_t wait_vsync_event;struct exynos_drm_panel_info panel; -struct exynos_drm_encoder *encoder; +struct drm_encoder *encoder; };static const struct of_device_id decon_driver_dt_match[] = {
drivers/gpu/drm/exynos/exynos_dp_core.c +46 -22
147 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_dp_core.h +1 -1
@@ -147,7 +147,7 @@ struct link_train { };struct exynos_dp_device { -struct exynos_drm_encoder encoder; +struct drm_encoder encoder;struct device *dev;struct drm_device *drm_dev;struct drm_connector connector;
drivers/gpu/drm/exynos/exynos_drm_core.c +0 -1
@@ -15,7 +15,6 @@#include <drm/drmP.h> #include "exynos_drm_drv.h" #include "exynos_drm_crtc.h" -#include "exynos_drm_encoder.h" #include "exynos_drm_fbdev.h" static LIST_HEAD (exynos_drm_subdrv_list);
drivers/gpu/drm/exynos/exynos_drm_crtc.c +0 -1
@@ -19,7 +19,6 @@#include "exynos_drm_crtc.h" #include "exynos_drm_drv.h" -#include "exynos_drm_encoder.h" #include "exynos_drm_plane.h" static void exynos_drm_crtc_enable (struct drm_crtc *crtc)
drivers/gpu/drm/exynos/exynos_drm_dpi.c +28 -23
132 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_drv.c +0 -1
@@ -21,7 +21,6 @@#include "exynos_drm_drv.h" #include "exynos_drm_crtc.h" -#include "exynos_drm_encoder.h" #include "exynos_drm_fbdev.h" #include "exynos_drm_fb.h" #include "exynos_drm_gem.h"
drivers/gpu/drm/exynos/exynos_drm_drv.h +6 -41
71 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_dsi.c +44 -36
176 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_encoder.c deleted +0 -105
105 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_drm_encoder.h deleted +0 -22
@@ -1,22 +0,0 @@ -/* -* Copyright (c) 2011 Samsung Electronics Co., Ltd. -* Authors: -* Inki Dae <[email protected]> -* Joonyoung Shim <[email protected]> -* Seung-Woo Kim <[email protected]> -* -* This program is free software; you can redistribute it and/or modify it -* under the terms of the GNU General Public License as published by the -* Free Software Foundation; either version 2 of the License, or (at your -* option) any later version. -*/ - -#ifndef _EXYNOS_DRM_ENCODER_H_ -#define _EXYNOS_DRM_ENCODER_H_ - -#include "exynos_drm_drv.h" - -int exynos_drm_encoder_create (struct drm_device *dev,struct exynos_drm_encoder - *encoder,enum exynos_drm_output_type type); - -#endif
drivers/gpu/drm/exynos/exynos_drm_fimd.c +1 -1
@@ -168,7 +168,7 @@ struct fimd_context {struct exynos_drm_panel_info panel;struct fimd_driver_data *driver_data; -struct exynos_drm_encoder *encoder; +struct drm_encoder *encoder; };static const struct of_device_id fimd_driver_dt_match[] = {
drivers/gpu/drm/exynos/exynos_drm_vidi.c +54 -17
124 lines not on this page · raw message
drivers/gpu/drm/exynos/exynos_hdmi.c +54 -36
205 lines not on this page · raw message
Signature · 1 line
2.1.0
Hi Gustavo,
Quoted 9 lines · Gustavo Padovan
From: Gustavo Padovan <[email protected]>
Hi,
This set improves exynos in a number of ways. The first five patches are general clean up/fixes.
Patches 06 to 12 are improvements on top of the newly added atomic modesetting support.
I'm not sure yet whether need locking for atomic asynchronous commit.
Quoted 6 lines
Patches 13-23 are a big journey to completely remove the internal
exynos_drm_encoderstruct. Now exynos encoders register themselves directly with the drm core.Please review!
I reviewed roughly and i think it seems be almost good. I will test it if i can have more time.
Thanks.
Quoted 43 lines
Gustavo
Gustavo Padovan (23):
drm/exynos: pass the correct pipe number
drm/exynos: calculate vrefresh instead of use a fixed value drm/exynos: use KMS version of DRM vblanks functions drm/exynos: remove duplicated check for suspend drm/exynos:Kconfig: select DP if FIMD or DECON are selected drm/exynos: add atomic asynchronous commit
drm/exynos: rename win_commit/disable to atomic-like names drm/exynos: pass structexynos_drm_planein update/enable drm/exynos: use drm atomic state directly
drm/exynos: remove unused fields from structexynos_drm_planedrm/exynos: unifyexynos_drm_planenames with drm core drm/exynos: don't track enabled state atexynos_crtcdrm/exynos: split display's .dpms() into .enable() and .disable() drm/exynos: remove wrappers for phy_power_{on,off} drm/exynos: remove unused .remove() and .check_mode() ops from display drm/exynos: simplify calculation of possible CRTCs drm/exynos: remove structexynos_drm_display
drm/exynos: remove extra call tohdmi_commit()
drm/exynos: remove extra call toexynos_dp_commit()drm/exynos: remove exynos_encoder's .commit() op drm/exynos: removeexynos_drm_create_enc_conn()drm/exynos: fold encoder setup intoexynos_drm_load()drm/exynos: remove structexynos_drm_encoderlayerdrivers/gpu/drm/exynos/Kconfig | 4 +- drivers/gpu/drm/exynos/Makefile | 7 +- drivers/gpu/drm/exynos/exynos7_drm_decon.c | 86 +++++++------- drivers/gpu/drm/exynos/exynos_dp_core.c | 122 +++++++++---------- drivers/gpu/drm/exynos/exynos_dp_core.h | 3 +- drivers/gpu/drm/exynos/exynos_drm_core.c | 36 ------ drivers/gpu/drm/exynos/exynos_drm_crtc.c | 33 ++---- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 4 +- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 96 ++++++++------- drivers/gpu/drm/exynos/exynos_drm_drv.c | 19 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 115 +++++------------- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 129 ++++++++++----------- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 174 ---------------------------- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 23 ---- drivers/gpu/drm/exynos/exynos_drm_fb.c | 51 ++++++--
Quoted 9 lines
drivers/gpu/drm/exynos/exynos_drm_fimd.c | 99 +++++++--------- drivers/gpu/drm/exynos/exynos_drm_plane.c | 31 ++--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 107 +++++++++-------- drivers/gpu/drm/exynos/exynos_hdmi.c | 168 +++++++++++++-------------- drivers/gpu/drm/exynos/exynos_mixer.c | 111 +++++++++--------- 20 files changed, 572 insertions(+), 846 deletions(-) delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_encoder.c delete mode 100644 drivers/gpu/drm/exynos/exynos_drm_encoder.h
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel