From mboxrd@z Thu Jan 1 00:00:00 1970 From: YoungJun Cho Subject: Re: [PATCH v2 10/18] drm/exynos: fimd: support I80 interface Date: Thu, 29 May 2014 14:45:48 +0900 Message-ID: <5386C98C.5010707@samsung.com> References: <1400647390-26590-1-git-send-email-yj44.cho@samsung.com> <1400647390-26590-11-git-send-email-yj44.cho@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Kurtz Cc: Mark Rutland , devicetree@vger.kernel.org, linux-samsung-soc , Pawel Moll , Ian Campbell , Seung-Woo Kim , dri-devel , Andrzej Hajda , Kyungmin Park , Rob Herring , Laurent Pinchart , Kumar Gala , Kukjin Kim , s.trumtrar@pengutronix.de List-Id: devicetree@vger.kernel.org Hi Daniel, On 05/26/2014 06:00 PM, Daniel Kurtz wrote: > Hi YoungJun, > > I am not famiilar with i80. Reading through this patch, it looks like > it works something like below for a page flip... > > -> page_flip ioctl > exynos_drm_crtc_page_flip() > exynos_drm_crtc_mode_set_commit() > exynos_plane_mode_set() > exynos_drm_crtc_commit() > exynos_plane_commit() > exynos_drm_crtc_plane_commit() > ops->win_commit() => fimd_win_commit() > update BASE (scanout) register > atomic_set(&ctx->win_updated, 1); > > ... at the next TE event ... > fimd_te_handler() > atomic_set(&ctx->win_updated, 0); > fimd_trigger(ctx->dev); > atomic_set(&ctx->triggering, 1); > VIDINTCON0 |= VIDINTCON0_INT_ENABLE; > TRIGCON |= TRGMODE_I80_RGB_ENABLE_I80 | SWTRGCMD_I80_RGB_ENABLE > ... start an i80 transaction to transfer frame data from BASE to > the panel ... > > ... write complete signalled by ... > -> FIMD interrupt: source = VIDINTCON0_INT_I80IFDONE | > VIDINTCON0_INT_SYSMAINCON (which one?) VIDINTCON0_INT_SYSMAINCON is for main LCD interrupt. So both are required. > fimd_irq_handler() > atomic_set(&ctx->triggering, 0); > drm_handle_vblank(ctx->drm_dev, ctx->pipe); > exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); > > Some questions/points: > (1) does the "i80 done" interrupt mean that the panel is now > displaying the new frame? Or just that the new frame is pending in a > panel-side scanout buffer? Is there a separate interrupt for (a) "i80 The 'i80 done' interrupt means that display controller(FIMD) completes sending the last line of screen(framebuffer) to DSI master. > transfer complete", and (b) "new frame now on main display"? The TE signal indicates that the panel completes dispatching gram. So like this: [ fimd ] : fimd_trigger() => frame done irq [ panel ] : te signal => show gram img > > (2) from the "DPMS off" patch, you mentioned that the panel sometimes > has an issue. Do you mean that sometimes when you trigger the i80 > transaction, there is no corresponding "i80ifdone / sysmaincon" No, I meant that fimd could miss TE signal if panel was reset / power off before generating it. > interrupt? If so, then I think you want to start a timer in > fimd_trigger(), that, if it expires before an I80IFDONE irq, will call > exynos_drm_crtc_finish_pageflip(), rather than hiding handling this > condition in dpms off of the exynos_drm_crtc.c layer. As you know that even though display controller missed TE signal and didn't trigger, the panel kept previous screen by self-refresh. After the panel recovers well and display controller sets next fb, then the panel would show it well without problem except current fb overwritten issue. But the dpms off case before the panel recovers well, there is no way to resolving pending event. Thank you. Best regards YJ > > Thanks, > -djk > > > > > On Wed, May 21, 2014 at 12:43 PM, YoungJun Cho wrote: >> To support MIPI DSI command mode interface, FIMD should do followings: >> - Sets LCD block configuration for I80 interface. >> - Uses "lcd_sys" as an IRQ resource and sets relevant IRQ configuration. >> - Implements trigger feature which transfers image date if there is >> page flip request, and implements TE handler to call trigger function. >> - Sets command mode timings configuration. >> - Sets ideal(pixel) clock is 2 times faster than the original one to >> generate frame done IRQ prior to the next TE signal. >> >> Signed-off-by: YoungJun Cho >> Acked-by: Inki Dae >> Acked-by: Kyungmin Park >> --- >> drivers/gpu/drm/exynos/Kconfig | 1 + >> drivers/gpu/drm/exynos/exynos_drm_fimd.c | 277 +++++++++++++++++++++++++----- >> include/video/samsung_fimd.h | 3 +- >> 3 files changed, 237 insertions(+), 44 deletions(-) >> >> diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig >> index 5bf5bca..f4d34f0 100644 >> --- a/drivers/gpu/drm/exynos/Kconfig >> +++ b/drivers/gpu/drm/exynos/Kconfig >> @@ -28,6 +28,7 @@ config DRM_EXYNOS_FIMD >> bool "Exynos DRM FIMD" >> depends on DRM_EXYNOS && !FB_S3C && !ARCH_MULTIPLATFORM >> select FB_MODE_HELPERS >> + select MFD_SYSCON >> help >> Choose this option if you want to use Exynos FIMD for DRM. >> >> diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> index 173ee97..9d585f9 100644 >> --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c >> @@ -20,11 +20,14 @@ >> #include >> #include >> #include >> +#include >> +#include >> >> #include