summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/exynos/exynos_drm_fimd.c
AgeCommit message (Collapse)Author
2015-02-07drm/exynos: use driver internal structJoonyoung Shim
Use driver internal struct as argument instead of struct exynos_drm_crtc except functions of exynos_drm_crtc_ops and instead of struct exynos_drm_display except functions of exynos_drm_display_ops. It can reduce unnecessary variable declaration. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-02-07drm/exynos: fix wrong pipe calculation for crtcJoonyoung Shim
We get wrong pipe value for crtc since commit 93bca243ec96 ("drm/exynos: remove struct exynos_drm_manager"). We should should increase pipe value before call exynos_drm_crtc_create. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: fimd: check error status for drm_iommu_attach_deviceAjay Kumar
check error status for drm_iommu_attach_device() and make sure it propagates till the caller. Signed-off-by: Ajay Kumar <ajaykumar.rs@samsung.com> Signed-off-by: Inki Dae <daeinki@gmail.com>
2015-01-25drm/exynos: don't duplicate drm_display_mode in fimd contextGustavo Padovan
We can safely use the mode stored in the crtc. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: remove struct exynos_drm_managerGustavo Padovan
exynos_drm_manager was just a redundant struct to represent the crtc as well. In this commit we merge exynos_drm_manager into exynos_drm_crtc to remove an unnecessary level of indirection easing the understand of the flow on exynos. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: remove drm_dev from struct exynos_drm_managerGustavo Padovan
manager-drm_dev is only accessed by exynos_drm_crtc_create() so this patch pass drm_dev as argument on exynos_drm_crtc_create() and remove it from struct exynos_drm_manager. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: move 'type' from manager to crtc structGustavo Padovan
'type' is now part of the struct exynos_drm_crtc. This is just another step in the struct exynos_drm_manager removal. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: remove pipe member of struct exynos_drm_managerGustavo Padovan
It is not longer used. This is part of the process of removing struct exynos_drm_manager entirely. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: add pipe param to exynos_drm_crtc_create()Gustavo Padovan
Get the pipe value from a parameter instead of getting it from manager->pipe. We are removing manager->pipe. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos/fimd: don't initialize 'ret' variable in fimd_probe()Gustavo Padovan
We set it in the beginning of the function, thus no need to set it at initialization. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-01-25drm/exynos: remove struct exynos_drm_overlayGustavo Padovan
struct exynos_drm_overlay has no practical advantage nor serves as important piece of the exynos API design. The only place it was used was inside the struct exynos_plane which was just causing a extra access overhead. Users had to access the overlay first and just then get the plane information it contains. This patch merges struct exynos_drm_overlay into struct exynos_plane. It also renames struct exynos_plane to struct exynos_drm_plane. The rational is to cut one step to access plane information. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-25drm/exynos: avoid leak if exynos_dpi_probe() failsGustavo Padovan
The component must be deleted if the probe fails. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos/dpi: embed display into private contextAndrzej Hajda
exynos_drm_display is used by internal Exynos DRM framework for representing encoder:connector pair. As it should be mapped 1:1 to dpi private context it seems more reasonable to embed it directly in that context. As a result further code simplification will be possible. Moreover it will be possible to handle multiple dpi devices in the system. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos/fimd: stop using manager->ctx pointerAndrzej Hajda
The patch replaces accesses to manager->ctx pointer by container_of construct. As fimd was the last user of ctx the patch removes this field as well. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos/fimd: embed manager into private contextAndrzej Hajda
exynos_drm_manager is used by internal Exynos DRM framework for representing crtc. As it should be mapped 1:1 to fimd private context it seems more reasonable to embed it directly in that context. As a result further code simplification will be possible. Moreover it will be possible to handle multiple FIMD devices in the system. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: use irq_flags instead of triggeringJoonyoung Shim
The drm_handle_vblank should be called whenever be vsync, te interrupt means vsync on i80 interface. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: add triggering unset routine in fimd_trigger()YoungJun Cho
There is a case like set config which requires triggering but vblank is not enabled yet. So triggering unset routine is required to exit from triggering mode. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: modify I80 i/f irq relevant routineYoungJun Cho
For the I80 interface, the video interrupt pending register(VIDINTCON1) should be handled in fimd_irq_handler() and the video interrupt control register(VIDINTCON0) should be handled in fimd_enable_vblank() and fimd_disable_vblank() like RGB interface. So this patch moves each set / unset routines into proper positions. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: add fimd_enable_shadow_channel_path() to cleanupYoungJun Cho
This function is valid only the SoC has SHADOWCON register and it should be used together with fimd_enable_video_output() to match the ENWIN_F bit in WINCON# and C#_EN_F bit in SHADOWCON. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: add fimd_enable_video_output() to cleanupYoungJun Cho
This bit is used for video output and logic signal control. So it is better for readability. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: move shadow unprotection positionYoungJun Cho
The C#_EN_F in SHADOWCON register is updated per frame. So it should be protected by fimd_shadow_protect_win(). Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: move triggering checkingJoonyoung Shim
It's better to be checking whether triggerring in fimd_trigger function. Also it will return if in triggerring on fimd_te_handler, then it can't execute remain codes. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: add has_vtsel flagJoonyoung Shim
The exynos fimd provides video type selection bits from system register but exynos3 series don't has it, so needs has_vtsel flag and we can distinguish whether set video type selection bits. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: move handle vblank position in TE handlerYoungJun Cho
For providing VBLANK information, drm_handle_vblank() should be called properly, but it is blocked by wait_vsync_event condition which is set by manager_ops->wait_for_vblank(). So moves it out from wait_vsync_event routine. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: remove unnecessary waiting vblank routineYoungJun Cho
The exynos_drm_crtc_dpms() waits until pended page flip queue is empty, calls the drm_vblank_off() then calls manager->ops->dpms() when mode is DRM_MODE_DPMS_OFF. The fimd_dpms() is one of manager->ops->dpms()s and finally calls fimd_window_suspend(). But there is no active window and vblank is already off when it is called. So addtional waiting vblank is not necessary any more. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-11-24drm/exynos: fimd: support Exynos4415 SoCYoungJun Cho
This patch supports Exynos4415 SoC. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos: switch to universal plane APIAndrzej Hajda
The patch replaces legacy functions drm_plane_init() / drm_crtc_init() with drm_universal_plane_init() and drm_crtc_init_with_planes(). It allows to replace fake primary plane with the real one. Additionally the patch leaves cleanup of crtcs to core, this way planes and crtcs are cleaned in correct order. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos: factor out initial setting of each driverJoonyoung Shim
From fimd driver and vidi driver, dev->irq_enabled and dev->vblank_disable_allowed are set and also mixer needs them even if missed. It's duplicated so set them when loads drm driver. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos: fimd: fix window clear codeMarek Szyprowski
To correctly disable hardware window during driver init, both enable bits (WINCONx_ENWIN in WINCON and SHADOWCON_CHx_ENABLE in SHADOWCON) must be cleared, otherwise hardware fails to re-enable such window later. While touching this function, also temporarily disable ctx->suspended flag to let fimd_wait_for_vblank function really to do its job. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-09-20drm/exynos: fimd: add Exynos3 SoC supportInki Dae
Signed-off-by: Inki Dae <inki.dae@samsung.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
2014-08-04Subject: Revert "drm/exynos: fix module build error"Sjoerd Simons
Since 21bdd17b21b45ea48e06e23918d681afbe0622e9 it is possible to have multiple calls to MODULE_DEVICE_TABLE, so the patch can be reverted to restore support for autoloading Conflicts: drivers/gpu/drm/exynos/exynos_drm_fimd.c drivers/gpu/drm/exynos/exynos_drm_g2d.c Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-08-03drm/exynos: fimd: support LCD I80 interfaceYoungJun Cho
To support MIPI command mode based I80 interface panel, FIMD should do followings: - Sets LCD I80 interface timings configuration. - Uses "lcd_sys" as an IRQ resource and sets relevant IRQ configuration. - Sets LCD block configuration for I80 interface. - Sets ideal(pixel) clock is 2 times faster than the original one to generate frame done IRQ prior to the next TE signal. - Implements trigger feature that transfers image data if there is page flip request, and implements TE handler to call trigger function. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-24drm/exynos: disable unused windows on applyAndrzej Hajda
The patch disables non-enabled HW windows on applying configuration, it will allow to clear windows enabled by bootloader. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: consider deferred probe caseInki Dae
This patch makes sure that exynos drm framework handles deferred probe case correctly. Sub drivers could be probed before resources, clock, regulator, phy or panel, are ready for them so we should make sure that exynos drm core waits until all resources are ready and sub drivers are probed correctly. Chagelog v2: - Make sure that exynos drm core tries to bind sub drivers only in case that they have a pair: crtc and encoder/connector components should be a pair. - Remove unnecessary patch: drm/exynos: mipi-dsi: consider panel driver-deferred probe - Return error type correctly. Signed-off-by: Inki Dae <inki.dae@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
2014-06-02drm/exynos: remove hardware overlays disable from fimd probeRahul Sharma
System hangs when FIMD registers are accessed to disable hardware overlays. This is because of the clocks which are not enabled before register access. 'Hardware overlay disable' is cleaned from the FIMD probe. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: use 4WORD dma burst length for small fbsRahul Sharma
In case of exynos, setting dma-burst to 16Word causes permanent tearing for very small buffers, e.g. cursor buffer. Burst Mode switching, which is based on overlay size is not recommended as overlay size varies a lot towards the end of the screen. This causes unstable DMA which results into tearing again. Rendering small buffers with lower burst size doesn't cause any noticable performance overhead. 128 pixel width is selected based on mulitple experiments with exynos5 SoCs. Signed-off-by: Rahul Sharma <Rahul.Sharma@samsung.com> Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: separate dpi from fimdAndrzej Hajda
The patch separates dpi related routines from fimd. Changelog v2: - Rename ctx->dpi to ctx->display Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: add component framework supportInki Dae
This patch adds component framework support to resolve the probe order issue. Until now, exynos drm had used codes specific to exynos drm to resolve that issue so with this patch, the specific codes are removed. Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-06-02drm/exynos: fimd: clear channel before enabling iommuAkshu Agrawal
If any fimd channel was already active, initializing iommu will result in a PAGE FAULT (e.e. u-boot could have turned on the display and not disabled it before the kernel starts). This patch checks if any channel is active before initializing iommu and disables it. Signed-off-by: Akshu Agrawal <akshu.a@samsung.com> Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: fimd: remove unused variableAndrzej Hajda
The patch removes unused vidcon0 field from fimd_context structure. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: restore parallel output interface supportAndrzej Hajda
The patch adds parallel output interface to FIMD device driver. It also restores support for panels initialized by boot loader, but without proper kernel driver. Driver uses video interface bindings to find connected panel. It uses drm_panel interface to interact with the panel. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: correct timing porch conversionAndrzej Hajda
The patch corrects porch calculation. It should be calculated as a difference between adjacent respective fields of drm_display_mode. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Consolidate suspend/resume in drm_drvSean Paul
This patch removes all of the suspend/resume logic from the individual drivers and consolidates it in drm_drv. This consolidation reduces the number of functions which enable/disable the hardware to just one -- the dpms callback. This ensures that we always power up/down in a consistent manner. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Clean up FIMD power on/off routinesSean Paul
This patch separates the fimd_activate function into poweron/poweroff functions to be more consistent with the other drivers in exynos drm. It also properly cleans up after failures in poweron. The functions have also been shuffled around such that they are all in the same spot in the file and poweron/poweroff can be called from the dpms function. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Move display implementation into dpSean Paul
This patch moves the exynos_drm_display implementation from fimd into the dp driver. This will allow for tighter integration of the dp driver into the exynos drm driver. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Remove unused/useless fimd_context membersSean Paul
This patch removes a few fimd_context members which are either entirely unused or unneeded. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Use mode_set to configure fimdSean Paul
This patch uses the mode passed into mode_set to configure fimd instead of directly using the panel from context. This will allow us to move the exynos_drm_display implementation out of fimd, where it doesn't belong. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Split manager/display/subdrvSean Paul
This patch splits display and manager from subdrv. The result is that crtc functions can directly call into manager callbacks and encoder functions can directly call into display callbacks. This will allow us to remove the exynos_drm_hdmi shim and support mixer/hdmi & fimd/dp with common code. Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Rename display_op power_on to dpmsSean Paul
This patch renames the display_op power_on to dpms to accurately reflect what the function does. The side-effect of this patch is that the new hdmi dpms callback is now invoked twice in the dpms path. This is safe and will be dealt with when the exynos_drm shim goes away. Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2014-03-24drm/exynos: Remove apply manager callbackSean Paul
This patch removes the apply() manager callback in favor of putting the relevant commits in the individual drivers. This will mitigate some of the difference between the suspend/resume path and the dpms path Signed-off-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Tomasz Figa <t.figa@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>