summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos
AgeCommit message (Collapse)AuthorFilesLines
2015-08-17Merge tag 'drm/panel/for-4.3-rc1' of ↵Dave Airlie1-1/+1
git://anongit.freedesktop.org/tegra/linux into drm-next drm/panel: Changes for v4.3-rc1 This introduces support for a couple of new panels and also contains some work to restructure the directories to get more consistency, to deal better with more panel and bridge drivers getting added. * tag 'drm/panel/for-4.3-rc1' of git://anongit.freedesktop.org/tegra/linux: drm/bridge: Put Kconfig entries in a separate menu drm/panel: Add support for LG LG4573 480x800 4.3" panel drm/panel: Add display timing for Okaya RS800480T-7X0GP of: Add Okaya Electric America vendor prefix drm/panel: simple: Add support for NEC NL4827HC19-05B 480x272 panel drm/panel: simple: Add support for AUO B080UAN01 drm/panel: simple: Correct minimum hsync length of the HannStar HSD070PWW1 panel drm/panel: simple: Add bus format for HannStar HSD070PWW1 LVDS panel drm/bridge: Add vendor prefixes drm/panel: Add Samsung prefix to panel drivers drm/exynos: Remove PTN3460 dependency
2015-08-16drm/exynos: merge exynos_drm_buf.c to exynos_drm_gem.cJoonyoung Shim9-334/+180
The struct exynos_drm_gem_obj can have fields of the struct exynos_drm_gem_buf then don't need to use exynos_drm_buf.c file. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: use prime helpersJoonyoung Shim6-313/+95
The dma-buf codes of exynos drm is almost same with prime helpers. A difference is that consider DMA_NONE when import dma-buf, but it's wrong and we don't consider it any more, so we can use prime interface. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove function roundup_gem_sizeJoonyoung Shim1-8/+1
The function roundup_gem_size can be merged in exynos_drm_gem_create. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove function update_vm_cache_attrJoonyoung Shim1-17/+11
The function update_vm_cache_attr can be merged in exynos_drm_gem_mmap. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove function check_gem_flagsJoonyoung Shim1-18/+5
The function check_gem_flags is too simple, so it's better to move codes in each consumer functions. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: use ERR_PTR instead of NULL in exynos_drm_gem_initJoonyoung Shim1-4/+4
For more correct error information. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove unused fields of struct exynos_drm_gem_bufJoonyoung Shim1-7/+0
The userptr, write and pfnmap of struct exynos_drm_gem_buf are not used anywhere. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: stop copying sg tableJoonyoung Shim3-40/+20
Already struct exynos_drm_gem_buf has pages of the buffer, so we don't need to copy from sg table of the buffer to sg table of dma-buf attachment, just can make sg table from pages of the buffer. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove function exynos_drm_gem_map_bufJoonyoung Shim1-24/+12
The exynos_drm_gem_map_buf can be merged in exynos_drm_gem_fault. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove mutex locking in pagefault handlerJoonyoung Shim1-5/+0
There is no reason to use mutex locking in pagefault handler. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove function convert_to_vm_err_msgJoonyoung Shim1-24/+10
The convert_to_vm_err_msg is called just once by exynos_drm_gem_fault, so it's simple not to use the function. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: stop using sgtable in page fault handlerJoonyoung Shim3-29/+19
Already struct exynos_drm_gem_buf has pages of the buffer when buffer is created, so just can use pages in page fault handler, we don't have to make sgtable of the buffer. But this needs to construct pages of the buffer that is imported from dma-buf prime. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove struct exynos_drm_encoder layerGustavo Padovan15-309/+259
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. v2: add empty .mode_fixup() and .mode_set() to DSI and DPI to avoid null pointer. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: fold encoder setup into exynos_drm_load()Gustavo Padovan3-16/+10
As we are removing the exynos encoder move the encoder setup operation directly inside the exynos_drm_load() Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove exynos_drm_create_enc_conn()Gustavo Padovan11-69/+101
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove exynos_encoder's .commit() opGustavo Padovan2-5/+0
.commit() is not used anymore, Exynos encoders now follow the .enable()/.disable() semantics from drm atomic core, so remove this callback. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove extra call to exynos_dp_commit()Gustavo Padovan1-4/+3
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove extra call to hdmi_commit()Gustavo Padovan1-12/+1
hdmi_commit() was getting called twice by exynos encoder core, once inside the .enable() call and another time by .commit() itself. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove struct exynos_drm_displayGustavo Padovan14-252/+177
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: simplify calculation of possible CRTCsGustavo Padovan1-24/+5
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove unused .remove() and .check_mode() ops from displayGustavo Padovan1-5/+0
These two display_ops are not used anywhere, remove them. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove wrappers for phy_power_{on,off}Gustavo Padovan1-15/+3
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: split display's .dpms() into .enable() and .disable()Gustavo Padovan6-130/+65
The DRM Core doesn't have a dpms() operation anymore, everything now is enable() or disable(). Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: return return value of exynos_crtc->enable_vblankGustavo Padovan1-1/+1
Instead of blindly ignore the return value of enable_vblank return it to the upper DRM layer for error handling. Suggested-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: unify exynos_drm_plane names with drm coreGustavo Padovan6-43/+44
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove unused fields from struct exynos_drm_planeGustavo Padovan1-18/+0
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: use drm atomic state directlyGustavo Padovan5-75/+75
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: pass struct exynos_drm_plane in update/enableGustavo Padovan7-65/+40
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. v2: don't remove check for suspended in FIMD (comment by Joonyoung) Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: rename win_commit/disable to atomic-like namesGustavo Padovan7-32/+32
Rename win_commit() helper to update_plane() and win_disable() to disable_plane(). Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove duplicated check for suspendGustavo Padovan2-6/+0
The same check is placed twice in fimd/decon_update_plane(), remove one of them. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: use KMS version of DRM vblanks functionsGustavo Padovan7-22/+20
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. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: pass the correct pipe numberGustavo Padovan1-1/+1
Instead of giving -1 to as arg to drm_send_vblank_event() pass the correct pipe number to it. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: clear channels only when iommu is enabledJoonyoung Shim1-1/+2
This is simplest solution about reported problem[1]. It's no problem to clear channel only when iommu is enabled, if we consider that we cannot recognize iommu errors when iommu is disabled and it have been valid until now. But this cannot be nice solution. [1] https://lkml.org/lkml/2015/7/21/404 Reported-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove drm_iommu_attach_device_if_possibleJoonyoung Shim7-31/+10
Already drm_iommu_attach_device checks whether support iommu internally. It should clear channels always regardless iommu support. We didn't know because we can detect the problem when iommu is enabled, so we don't have to use drm_iommu_attach_device_if_possible and then we can remove drm_iommu_attach_device_if_possible and clear_channels function pointer. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: move order to register vidi kms driverJoonyoung Shim1-3/+3
The vidi is virtual kms driver and now it is registered earlier than actual hw kms drivers, so it will occupy crtc index 0. Some users assume the condition yet that actual hw kms driver has crtc index 0. It may or may not be matter but let's arrange register order. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/mixer: replace MXR_INT_EN register cache with flagAndrzej Hajda1-11/+9
Driver uses only VSYNC interrupts, so we need to cache VSYNC bit state only. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/mixer: simplify poweron flagAndrzej Hajda1-38/+14
The driver uses bool protected by mutex to track power state. The patch replaces this combo with single bit and atomic bitops. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove unnecessary checking to support iommuJoonyoung Shim7-38/+13
Already drm_iommu_attach_device and drm_iommu_detach_device check whether support iommu internally, so we don't have to call is_drm_iommu_supported before call them. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: remove to use ifdef CONFIG_ARM_DMA_USE_IOMMUJoonyoung Shim1-4/+0
If CONFIG_ARM_DMA_USE_IOMMU is disable, CONFIG_DRM_EXYNOS_IOMMU also is disable. When CONFIG_DRM_EXYNOS_IOMMU is disable, is_drm_iommu_supported() returns always false, so we can remove to use ifdef CONFIG_ARM_DMA_USE_IOMMU in is_drm_iommu_supported(). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos: gsc: Handles the combination of rotation and flipHyungwon Hwang1-0/+16
The unique results of all the combination of rotation and flip can be represented by just 8 states. This patch handles all the combination correctly. Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: remove hdmi_v14_conf structAndrzej Hajda1-318/+109
The patch removes intermediate struct for HDMIv14 register configuration, instead registry values are calculated on the fly. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: remove hdmi_v13_conf structAndrzej Hajda1-179/+101
The patch removes intermediate struct for HDMIv13 register configuration, instead registry values are calculated on the fly. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: remove redundant configuration fieldsAndrzej Hajda1-44/+24
The patch removes redundant fields from hdmi_conf_regs. Their values can be calculated from current_mode. This patch is the first step to remove whole hdmi_conf_regs structure. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: add driver data pointer to private contextAndrzej Hajda1-29/+20
The patch replaces duplicated driver data fields in private context with pointer to driver data. It also simplifies driver data lookup code. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: remove private lock codeAndrzej Hajda1-24/+3
Most of the code is called by drm core framework, so it is already synchronized. The only async function is irq routine which only calls drm framework so it does not need to be synchronized. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: Simplify HPD gpio handlingAndrzej Hajda1-10/+3
GPIO is tested only in hdmi_detect, so there is no reason to set it in other places and to preserve its value in context. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/hdmi: remove old platform data codeAndrzej Hajda1-31/+5
s5p_hdmi_platform_data were used before device tree introduction. As HDMI driver is DT only we can drop this struct completely. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/fimc: fix runtime pm supportMarek Szyprowski1-1/+0
Once pm_runtime_set_active() gets called, the kernel assumes that given device has already enabled runtime pm and will call pm_runtime_suspend() without matching pm_runtime_resume(). In case of DRM FIMC IPP driver, this will result in calling clk_disable() without respective call to clk_enable(). This patch removes call to pm_runtime_set_active() to ensure that pm_runtime_suspend/resume calls will match. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-08-16drm/exynos/mixer: always update INT_EN cacheAndrzej Hajda1-0/+5
INT_EN cache field was updated only by mixer_enable_vblank. The patch adds update also by mixer_disable_vblank function. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>