summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/exynos
AgeCommit message (Collapse)Author
2015-11-03drm/exynos/gem: remove DMA-mapping hacks used for constructing page arrayMarek Szyprowski
Exynos GEM objects contains an array of pointers to the pages, which the allocated buffer consists of. Till now the code used some hacks (like relying on DMA-mapping internal structures or using ARM-specific dma_to_pfn helper) to build this array. This patch fixes this by adding proper call to dma_get_sgtable_attrs() and using the acquired scatter-list to construct needed array. This approach is more portable (work also for ARM64) and finally fixes the layering violation that was present in this code. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos: simplify Kconfig component namesAndrzej Hajda
Many Exynos DRM sub-options mentions Exynos DRM in their titles. It is redundant and can be safely shortened. The patch additionally makes some entries more descriptive. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos: re-arrange Kconfig entriesAndrzej Hajda
Exynos DRM driver have quite big number of components and options. The patch re-arranges them into three logical groups: - CRTCs, - Encoders and Bridges, - Sub-drivers. It should make driver options more clear. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos: abstract out common dependencyAndrzej Hajda
All options depends on DRM_EXYNOS so it can be moved to enclosing if clause. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos: separate Mixer and HDMI driversAndrzej Hajda
Latest Exynos SoCs does not have Mixer IP, but they still have HDMI IP. Their drivers should be configurable separately. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/mixer: replace direct cross-driver call with drm mode validationAndrzej Hajda
HDMI driver called directly function from MIXER driver to invalidate modes not supported by MIXER. The patch replaces the hack with proper .atomic_check callback. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos: add atomic_check callback to exynos_crtcAndrzej Hajda
Some CRTCs needs mode validation, this patch adds neccessary callback to Exynos DRM framework. It is called from DRM core via atomic_check helper for drm_crtc. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/decon5433: add support for DECON-TVAndrzej Hajda
DECON-TV IP is responsible for generating video stream which is transferred to HDMI IP. It is almost fully compatible with DECON IP. The patch is based on initial work of Hyungwon Hwang. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/decon5433: remove duplicated initializationAndrzej Hajda
Field .commit is already initialized few lines above. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/decon5433: merge different flag fieldsAndrzej Hajda
Driver uses four different fields for internal flags. They can be merged into one. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/decon5433: add function to set particular register bitsAndrzej Hajda
The driver often sets only particular bits of configuration registers. Using separate function to such action simplifies the code. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/decon5433: fix timing registers writesAndrzej Hajda
All timing registers should contain values decreased by one. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-11-03drm/exynos/decon5433: add PCLK clockAndrzej Hajda
PCLK clock is used by DECON IP. The patch also replaces magic number with number of clocks in array definition. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos: cleanup name of gem object for exynos_drmJoonyoung Shim
Struct of gem object in exynos_drm driver is struct exynos_drm_gem_obj. It's too long and we can know its meaning of name without _obj postfix. We use several names to variable name of gem object for exynos_drm - exynos_gem_obj, gem_obj and obj. Especially "obj" name can cause misunderstanding with variable name "obj" of struct drm_gem_object. This will clean about name of gem object for exynos_drm as follows. s/struct exynos_drm_gem_obj/struct exynos_drm_gem s/exynos_gem_obj or gem_obj or obj/exynos_gem Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos: fix to detach device of iommuJoonyoung Shim
The arm_iommu_detach_device() is a function to detach device of iommu attached by arm_iommu_attach_device(). The exynos-drm uses arm_iommu_attach_device() so it should use arm_iommu_detach_device() to detach device of iommu, not iommu_detach_device(). The drm_release_iommu_mapping() is a function to release mapping of iommu created by arm_iommu_create_mapping(). It is called by exynos_drm_unload() so shouldn't be called by drm_iommu_detach_device(). Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos: add cursor plane supportGustavo Padovan
Set one of the planes for each crtc driver as a cursor plane enabled window managers to fully work on exynos. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos: add global macro for the default primary planeGustavo Padovan
Define DEFAULT_WIN as zero to help set the primary plane on all CRTCs. Some CRTCs were defining a variable to store the default window, but that is not necessary as the default (primary) window is always the window zero. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos: fix spelling errorsIngi Kim
This patch fixes spelling errors in drm fimc/gsc inavild -> invaild Signed-off-by: Ingi Kim <ingi2.kim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm: exynos: mixer: fix using usleep() in atomic contextTomasz Stanislawski
This patch fixes calling usleep_range() after taking reg_slock using spin_lock_irqsave(). The mdelay() is used instead. Waiting in atomic context is not the best idea in general. Hopefully, waiting occurs only when Video Processor fails to reset correctly. Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: remove unused fieldAndrzej Hajda
The patch removes unused hdmi_context field. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: improve HDMI/ACR related codeAndrzej Hajda
Simple formula can be used to calculate CTS and N coefficients. Additionaly ACR registers have different offsets for different versions of IP. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: convert container_of macro to inline functionAndrzej Hajda
Inline function is safer than macro, also the name has been changed to be consistent with other inline function encoder_to_hdmi. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: remove deprecated hdmi_resources structureAndrzej Hajda
hdmi_resources structure was filled by old platform data code and is not necessary anymore. The patch removes it at groups together resource related fields in hdmi_context. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: convert to gpiod APIAndrzej Hajda
The patch converts API to gpiod and moves initialization code to hdmi_resources_init. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: simplify clock re-parentingAndrzej Hajda
Driver tries to disable sclk_hdmi during re-parenting, to avoid possible glitches. It is ineffective as the clock is used also by other devices (mixer). Anyway driver works without disabling sclk_hdmi. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: use constant size array for regulatorsAndrzej Hajda
Driver always uses the same number of regulators, so there is no point in dynamic allocation. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: use optional regulator_get for hdmi-enAndrzej Hajda
hdmi-en is an optional regulator so it should be better handled by devm_regulator_get_optional call. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: fix removal orderAndrzej Hajda
DRM device should be destroyed before releasing resources. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: replace all writeb with writelAndrzej Hajda
Registers are 32-bit, even if only lower 8-bits are used. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: simplify HDMI-PHY power sequenceAndrzej Hajda
Currently driver tries to set specific HDMI-PHY registers in three situations: - before reset, - before power off, - after applying HDMI-PHY configuration. First two cases seems to be unnecessary - register contents will be lost anyway. The third case can be merged with HDMI-PHY configuration by fixing the last byte of configuration data. The patch has been tested with following platforms: - exynos4210-universal_c210, - exynos4412-odroidu3, - exynos5422-odroidxu3. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: move PLL stabilization check code to separate functionAndrzej Hajda
The patch moves PLL stabilization check to separate function, adjust timeout parameters and de-duplicates code common for both HW variants. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: use mappings for registers with IP dependent addressAndrzej Hajda
Some registers resides at different offsets depending on device version. This patch adds infrastructure for mapping such registers to proper address based on hdmi_type. It adds also mappings to some registers. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-26drm/exynos/hdmi: remove support for deprecated compatibleAndrzej Hajda
This compatible was marked as deprecated in Jun 2013 and it is not used since then. Additionally its driver data points to wrong pll settings, so it cannot work anyway. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-19Merge tag 'topic/drm-misc-2015-10-19' of ↵Dave Airlie
git://anongit.freedesktop.org/drm-intel into drm-next More drm-misc for 4.4. - fb refcount fix in atomic fbdev - various locking reworks to reduce drm_global_mutex and dev->struct_mutex - rename docbook to gpu.tmpl and include vga_switcheroo stuff, plus more vga_switcheroo (Lukas Wunner) - viewport check fixes for atomic drivers from Ville - DRM_DEBUG_VBL from Ville - non-contentious header fixes from Mikko Rapeli - small things all over * tag 'topic/drm-misc-2015-10-19' of git://anongit.freedesktop.org/drm-intel: (31 commits) drm/fb-helper: Fix fb refcounting in pan_display_atomic drm/fb-helper: Set plane rotation directly drm: fix mutex leak in drm_dp_get_mst_branch_device drm: Check plane src coordinates correctly during page flip for atomic drivers drm: Check crtc viewport correctly with rotated primary plane on atomic drivers drm: Refactor plane src coordinate checks drm: Swap w/h when converting the mode to src coordidates for a rotated primary plane drm: Don't leak fb when plane crtc coodinates are bad ALSA: hda - Spell vga_switcheroo consistently drm/gem: Use kref_get_unless_zero for the weak mmap references drm/vgem: Drop vgem_drm_gem_mmap drm: Fix return value of drm_framebuffer_init() drm/gem: Use container_of in drm_gem_object_free drm/gem: Check locking in drm_gem_object_unreference drm/gem: Drop struct_mutex requirement from drm_gem_mmap_obj drm/i810_drm.h: include drm/drm.h r128_drm.h: include drm/drm.h savage_drm.h: include <drm/drm.h> gpu/doc: Convert to markdown harder gpu/doc: Add vga_switcheroo documentation ...
2015-10-16drm/<drivers>: Drop DRM_UNLOCKED from modeset driversDaniel Vetter
Just one special case (since i915 lost its ums code, yay): - radeon: Has slots for the old ums ioctls which don't have DRM_UNLOCKED, but all filled with drm_invalid_op. So ok to drop it everywhere. Every other kms driver just has DRM_UNLOCKED for all their ioctls, as they should. v2: admgpu happened, include that one too. And i915 lost its UMS support which means we can change all the i915 ioctls too. v3: Rebased on top of new vmwgfx DX interface extensions. v4: Rebase on top of render-node support in exynos. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-16Merge commit '06d1ee32a4d25356a710b49d5e95dbdd68bdf505' of ↵Dave Airlie
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into drm-next Backmerge the drm-fixes pull from Linus's tree into drm-next. This is to fix some conflicts and make future pulls cleaner
2015-10-07drm: Stop using drm_vblank_count() as the hw frame counterVille Syrjälä
drm_vblank_count() returns the software counter. We should not pretend it's the hw counter since we use the hw counter to figuere out what the software counter value should be. So instead provide a new function drm_vblank_no_hw_counter() for drivers that don't have a real hw counter. The new function simply returns 0, which is about the only thing it can do. Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Thierry Reding <treding@nvidia.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Vincent Abriou <vincent.abriou@st.com> [danvet: s/int pipe/unsigned int pipe/ to follow Thierry's interface change.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-06drm/irq: Use unsigned int pipe in public APIThierry Reding
This continues the pattern started in commit cc1ef118fc09 ("drm/irq: Make pipe unsigned and name consistent"). This is applied to the public APIs and driver callbacks, so pretty much all drivers need to be updated to match the new prototypes. Cc: Christian König <christian.koenig@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Russell King <rmk+kernel@arm.linux.org.uk> Cc: Inki Dae <inki.dae@samsung.com> Cc: Jianwei Wang <jianwei.wang.chn@gmail.com> Cc: Alison Wang <alison.wang@freescale.com> Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: David Airlie <airlied@linux.ie> Cc: Rob Clark <robdclark@gmail.com> Cc: Ben Skeggs <bskeggs@redhat.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Benjamin Gaignard <benjamin.gaignard@linaro.org> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-10-01drm/exynos: Staticize local function in exynos_drm_gem.cKrzysztof Kozlowski
The exynos_drm_gem_mmap_buffer() is not used outside so make it static. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-01drm/exynos: fimd: actually disable dp clockGustavo Padovan
fimd_dp_clock_enable() was setting the always to enabled, this patch fix this to actually use the value that is set to 'val'. Reported-by: Emilio López <emilio.lopez@collabora.co.uk> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-10-01drm/exynos: dp: remove suspend/resume functionsInki Dae
This patch removes unnecessary pm suspend/resume functions. All kms sub drivers will be controlled by top of Exynos drm driver and connector dpms so these sub drivers shouldn't have their own pm interfaces. Signed-off-by: Inki Dae <inki.dae@samsung.com> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
2015-09-30drm/exynos: remove unused mode_fixup() codeGustavo Padovan
CRTC's mode_fixup() isn't used anymore in exynos, remove it. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: remove decon_mode_fixup()Gustavo Padovan
The only thing mode_fixup was doing was set the adjusted_mode->vrefresh to 60, but it already has the value of 60 when the decon_mode_fixup() is called. That means this call is actually pointless and can be removed. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: remove fimd_mode_fixup()Gustavo Padovan
The only thing mode_fixup was doing was set the adjusted_mode->vrefresh to 60, but it already has the value of 60 when the fimd_mode_fixup() is called. That means this call is actually pointless and can be removed. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: rotator: Clock control is unused if !PMThierry Reding
Protect the rotator_clk_crtl() function with an #ifdef CONFIG_PM guard to avoid "defined but not used" warnings. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: fimc: Clock control is unused if !PMThierry Reding
Protect the fimc_clk_ctrl() function with an #ifdef CONFIG_PM guard to avoid "defined but not used" warnings. Signed-off-by: Thierry Reding <treding@nvidia.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: Suspend/resume is unused if !PMThierry Reding
Protect the suspend and resume callbacks with an #ifdef CONFIG_PM_SLEEP guard to avoid "defined but not used" warnings. Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: create a fake mmap offset with gem creationJoonyoung Shim
Don't create a fake mmap offset in exynos_drm_gem_dumb_map_offset. If not, it will call drm_gem_create_mmap_offset whenever user requests DRM_IOCTL_MODE_MAP_DUMB ioctl. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: remove call to drm_gem_free_mmap_offset()Joonyoung Shim
The drm_gem_object_release() function already performs this cleanup, so there is no reason to do it explicitly. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2015-09-30drm/exynos: Remove useless EXPORT_SYMBOL_GPLsDaniel Kurtz
All the user of these functions are inside exynos-drm driver and you don't need to export the symbols for that case. Signed-off-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Inki Dae <inki.dae@samsung.com>