summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
AgeCommit message (Collapse)Author
2012-12-15drm/exynos: add iommu support for ippEunchul Kim
This patch adds iommu support for IPP subsystem framework. For this, it adds subdrv_probe/remove callback to enable or disable ipp iommu. We can get or put device address to a gem handle from user through exynos_drm_gem_get/put_dma_addr(). Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com> Signed-off-by: Jinyoung Jeon <jy0.jeon@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-15drm/exynos: add ipp subsystemEunchul Kim
This patch adds Image Post Processing(IPP) support for exynos drm driver. IPP supports image scaler/rotator and input/output DMA operations using IPP subsystem framework to control FIMC, Rotator and GSC hardware and supports some user interfaces for user side. And each IPP-based drivers support Memory to Memory operations with various converting. And in case of FIMC hardware, it also supports Writeback and Display output operations through local path. Features: - Memory to Memory operation support. - Various pixel formats support. - Image scaling support. - Color Space Conversion support. - Image crop operation support. - Rotate operation support to 90, 180 or 270 degree. - Flip operation support to vertical, horizontal or both. - Writeback operation support to display blended image of FIMD fifo on screen A summary to IPP Subsystem operations: First of all, user should get property capabilities from IPP subsystem and set these properties to hardware registers for desired operations. The properties could be pixel format, position, rotation degree and flip operation. And next, user should set source and destination buffer data using DRM_EXYNOS_IPP_QUEUE_BUF ioctl command with gem handles to source and destinition buffers. And next, user can control user-desired hardware with desired operations such as play, stop, pause and resume controls. And finally, user can aware of dma operation completion and also get destination buffer that it contains user-desried result through dequeue command. IOCTL commands: - DRM_EXYNOS_IPP_GET_PROPERTY . get ipp driver capabilitis and id. - DRM_EXYNOS_IPP_SET_PROPERTY . set format, position, rotation, flip to source and destination buffers - DRM_EXYNOS_IPP_QUEUE_BUF . enqueue/dequeue buffer and make event list. - DRM_EXYNOS_IPP_CMD_CTRL . play/stop/pause/resume control. Event: - DRM_EXYNOS_IPP_EVENT . a event to notify dma operation completion to user side. Basic control flow: Open -> Get properties -> User choose desired IPP sub driver(FIMC, Rotator or GSCALER) -> Set Property -> Create gem handle -> Enqueue to source and destination buffers -> Command control(Play) -> Event is notified to User -> User gets destinition buffer complated -> (Enqueue to source and destination buffers -> Event is notified to User) * N -> Queue/Dequeue to source and destination buffers -> Command control(Stop) -> Free gem handle -> Close Changelog v1 ~ v5: - added comments, code fixups and cleanups. Signed-off-by: Eunchul Kim <chulspro.kim@samsung.com> Signed-off-by: Jinyoung Jeon <jy0.jeon@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-15drm/exynos: support device tree for fimdJoonyoung Shim
This adds the of_match_table to exynos-drm fimd driver to be probed from the device tree. Changelog v2: - fix build error without CONFIG_OF. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-14radeon: fix regression with eviction since evict caching changesDave Airlie
Since 0d0b3e7443bed6b49cb90fe7ddc4b5578a83a88d drm/radeon: use cached memory when evicting for vram on non agp evicting from TTM would try and evict to TTM instead of system, not so good. This should fix: https://bugs.freedesktop.org/show_bug.cgi?id=58272 Signed-off-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: add more pedantic checks in the CP DMA checkerAlex Deucher
non-mem-to-mem transfers require dw aligned byte count. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: bump version for CS ioctl support for async DMAAlex Deucher
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: enable the async DMA rings in the CS ioctlAlex Deucher
This enables the functionality added in the previous patches. Userspace acceleration drivers can use the CS ioctl to submit command buffers to the async DMA rings. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: add VM CS parser support for async DMA on cayman/TN/SIAlex Deucher
Allows us to use async DMA from userspace. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon/kms: add evergreen/cayman CS parser for async DMA (v2)Alex Deucher
Allows us to use the DMA ring from userspace. DMA doesn't have a good NOP packet in which to embed the reloc idx, so userspace has to add a reloc for each buffer used and order them to match the command stream. v2: fix address bounds checking Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon/kms: add 6xx/7xx CS parser for async DMA (v2)Alex Deucher
Allows us to use the DMA ring from userspace. DMA doesn't have a good NOP packet in which to embed the reloc idx, so userspace has to add a reloc for each buffer used and order them to match the command stream. v2: fix address bounds checking, reloc indexing Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: fix htile buffer size computation for command stream checkerJerome Glisse
Fix the size computation of the htile buffer. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: fix fence locking in the pageflip callbackDaniel Vetter
We need to hold bdev->fence_lock while grabbing a reference to the fence, to prevent concurrent clearing/changing of the ttm_bo->sync_obj field. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: make indirect register access concurrency-safeDaniel Vetter
With the new per-crtc locking mutliple set-cursor calls could happen in parallel. Out of sheer paranoia I've opted for an irqsave spinlock. But if there's indeed an access from interrupt contexts to these regs it's already broken with the old code, so this can likely just be reduced to a normal spinlock. Otoh the pageflip completion happens from the vblank irq handler ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesssDaniel Vetter
Just refactoring to make the next patche simpler. Now all indirect register access in the new modesetting driver should go through the r100_mm_(w|r)reg fucntions. RADEON_READ_MM from the old driver seems to be totally unused, so just kill it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-14drm/exynos: support extended screen coordinate of fimdJoonyoung Shim
The fimd of exynos5 SoC supports extended screen coordinate. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: fix x, y coordinates for right bottom pixelJoonyoung Shim
The x, y coordinates of right bottom pixel cannot be negative numbers. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: fix fb offset calculation for planeJoonyoung Shim
There is no any reason to change fb offset when CRTC is out of screen. Also, this fixes a typing error. Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: hdmi: Fix potential NULL pointer dereference errorSachin Kamat
This is an unlikely case. However to silence the following smatch error add a NULL check: drivers/gpu/drm/exynos/exynos_hdmi.c:2486 hdmi_probe() error: potential NULL dereference 'match'. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: hdmi: Add CONFIG_OF and use of_match_ptr() macroSachin Kamat
Add CONFIG_OF to compile conditionally. of_match_ptr eliminates having an #ifdef returning NULL for the case when OF is disabled. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: add support for hdmiphy power control for exynos5Rahul Sharma
This patch adds support for controlling power of hdmi phy for exynos5 soc. A special bit is provided in exynos5 for directly switching of PHY while in exynos4, phy power needs to be controlled through i2c settings. I2C configuration may affect the suspend to resume and wake-up time requirements hence not added. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: add runtime pm support for mixerRahul Sharma
This patch adds support for runtime power management for drm mixer driver. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Shirish S <s.shirish@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: added runtime pm support for hdmiRahul Sharma
This patch adds runtime power management support for exynos drm hdmi driver. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Shirish S <s.shirish@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-14drm/exynos: fix allocation and cache mapping typeInki Dae
This patch fixes memory alloction(contiguous or not) and cache mapping types(cachable or not). For this, it converts each type from user request into dma attribute properly. Changelog v2: - just code cleanup. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-14drm/exynos: reorder framebuffer init sequenceDaniel Vetter
For user framebuffers it's easier to just inline the exynos_drm_framebuffer_init helper instead of trying to adjust it - most of the things that helper sets up need to be overwritten anyway again due to the multiple backing storage objects support exynos has, but does not use for the fbdev. Changelog v2: - fix NULL point issue to first gem object of exynos drm framebuffer. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/i915: Fix missed needs_dmar settingZhenyu Wang
From Ben's AGP dependence removal change, "needs_dmar" flag has not been properly setup for new chips using new GTT init function. This one adds missed setting of that flag to make sure we do pci mappings with IOMMU enabled. Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-12-13Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial branch from Jiri Kosina: "Usual stuff -- comment/printk typo fixes, documentation updates, dead code elimination." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (39 commits) HOWTO: fix double words typo x86 mtrr: fix comment typo in mtrr_bp_init propagate name change to comments in kernel source doc: Update the name of profiling based on sysfs treewide: Fix typos in various drivers treewide: Fix typos in various Kconfig wireless: mwifiex: Fix typo in wireless/mwifiex driver messages: i2o: Fix typo in messages/i2o scripts/kernel-doc: check that non-void fcts describe their return value Kernel-doc: Convention: Use a "Return" section to describe return values radeon: Fix typo and copy/paste error in comments doc: Remove unnecessary declarations from Documentation/accounting/getdelays.c various: Fix spelling of "asynchronous" in comments. Fix misspellings of "whether" in comments. eisa: Fix spelling of "asynchronous". various: Fix spelling of "registered" in comments. doc: fix quite a few typos within Documentation target: iscsi: fix comment typos in target/iscsi drivers treewide: fix typo of "suport" in various comments and Kconfig treewide: fix typo of "suppport" in various comments ...
2012-12-13drm/exynos/iommu: fix return value check in drm_create_iommu_mapping()Wei Yongjun
In case of error, function arm_iommu_create_mapping() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: remove unused vaddr memberYoungJun Cho
This patch removes vaddr member from exynos_drm_overlay structure and also relevant codes for code cleanup. Signed-off-by: YoungJun Cho <yj44.cho@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13drm/exynos: use DMA_ATTR_NO_KERNEL_MAPPING attributeInki Dae
Changelog v3: just code cleanup. Changelog v2: fix argument to dma_mmap_attr function. - use pages instead of kvaddr because kvaddr is 0 with DMA_ATTR_NO_KERNEL_MAPPING. Changelog v1: When gem allocation is requested, kernel space mapping isn't needed. But if need, such as console framebuffer, the physical pages would be mapped with kernel space though vmap function. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13drm/exynos: add exception codes to exynos_drm_fbdev_create()Inki Dae
This patch releases allocated resources correctly. Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13drm/exynos: clear windows in fimd dpms offPrathyush K
Changelog v2: Added details of original patch in chromium kernel Changelog v1: When fimd is turned off, we disable the clocks which will stop the dma. Now if we remove the current framebuffer, we cannot disable the overlay but the current framebuffer will still be freed. When fimd resumes, the dma will continue from where it left off and will throw a PAGE FAULT since the memory was freed. This patch fixes the above problem by disabling the fimd windows before disabling the fimd clocks. It also keeps track of which windows were currently active by setting the 'resume' flag. When fimd resumes, the window with a resume flag set is enabled again. Now if a current fb is removed when fimd is off, fimd_win_disable will set the 'resume' flag of that window to zero and return. So when fimd resumes, that window will not be resumed. This patch is based on the following two patches: http://git.chromium.org/gitweb/?p=chromiumos/third_party/kernel.git;a=commitdiff;h=341e973c967304976a762211b6465b0074de62ef http://git.chromium.org/gitweb/?p=chromiumos/third_party/kernel.git;a=commitdiff;h=cfa22e49b7408547c73532c4bb03de47cc034a05 These two patches are rebased onto the current kernel with additional changes like removing 'fimd_win_commit' call from the resume function since this is taken care by encoder dpms, and the modification of resume flag in win_disable. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Stephane Marchesin <marcheu@chromium.org> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: clear windows in mixer dpms offPrathyush K
When mixer is turned off, we disable the clocks which will stop the dma. Now if we remove the current framebuffer, we cannot disable the overlay but the current framebuffer will still be freed. When mixer resumes, the dma will continue from where it left off and will throw a PAGE FAULT since the memory was freed. This patch fixes the above problem by disabling the mixer windows before disabling the mixer clocks. It also keeps track of which windows were currently active by setting the 'resume' flag. When mixer resumes, the window with a resume flag set is enabled again. Now if a current fb is removed when mixer is off, mixer_win_disable will set the 'resume' flag of that window to zero and return. So when mixer resumes, that window will not be resumed. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: modify wait_for_vblank of fimdPrathyush K
It is more optimium to use wait queues while waiting for vsync so that the current task is put to sleep. This way, the task wont hog the CPU while waiting. We use wait_event_timeout and not an interruptible function since we dont want the function to exit when a signal is pending (e.g. drm release). This patch modifies the wait for vblank function of fimd. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: modify wait_for_vblank of mixerPrathyush K
It is more optimium to use wait queues while waiting for vsync so that the current task is put to sleep. This way, the task wont hog the CPU while waiting. We use wait_event_timeout and not an interruptible function since we dont want the function to exit when a signal is pending (e.g. drm release). This patch modifies the wait for vblank function of mixer. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: move fimd wait_for_vblank to manager_opsPrathyush K
The wait for vblank callback is moved from overlay_ops to manager_ops for fimd. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: move hdmi's wait_for_vblank to manager_opsPrathyush K
The wait_for_vblank callback of hdmi and mixer is now moved from overlay_ops to manager_ops. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: make wait_for_vblank a manager opPrathyush K
Changelog v2: remove unnecessay wait_for_vblank call. - with this patch, wait_for_vblank callback is moved from overlay ops to manager ops so it should be removed and it doesn't need to wait vblank signal at plane disable. Changelog v1: The wait_for_vblank callback is moved from overlay ops to manager ops of exynos drm driver. Also, the check for DPMS OFF of encoder is removed before calling wait_for_vblank. Signed-off-by: Prathyush K <prathyush.k@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
2012-12-13drm/exynos: add dmabuf attach/detach callbacks.Inki Dae
With this patch, When dma_buf_unmap_attachment is called, the pages of sgt aren't unmapped from iommu table. Instead, when dma_buf_detach is called, that would be done. And also removes exynos_get_sgt function used to get clone sgt and uses attachment's sgt instead. This patch would resolve performance deterioration issue when v4l2-based driver is using the buffer imported from gem. This change is derived from videobuf2-dma-contig.c Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13drm: exynos: moved exynos drm hdmi device registration to drm driverRahul Sharma
This patch moved the exynos-drm-hdmi platform device registration to the drm driver. When DT is enabled, platform devices needs to be registered within the driver code. This patch fits the requirement of both DT and Non DT based drm drivers. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-13drm: exynos: moved exynos drm device registration to drm driverRahul Sharma
This patch moved the exynos-drm platform device registration to the drm driver. When DT is enabled, platform devices needs to be registered within the driver code. This patch fits the requirement of both DT and Non DT based drm drivers. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2012-12-12drm/radeon: fix fence driver for dma ring when wb is disabledJerome Glisse
The dma ring can't write to register thus have to write to memory its fence value. This ensure that it doesn't try to use scratch register for dma ring fence driver. Should fix: https://bugs.freedesktop.org/show_bug.cgi?id=58166 Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon/si: add VM CS checker support for CP DMAAlex Deucher
Need to verify for copies involving registers. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon/cayman: add VM CS checker support for CP DMAAlex Deucher
Need to verify for copies involving registers. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon: add support for CP DMA packet to evergreen CS checkerAlex Deucher
Currently only memory and GDS transfers are allowed. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon: add support for CP DMA packet to r6xx/r7xx CS checkerAlex Deucher
Currently only memory to memory transfers are allowed. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon: add register headers for CP DMA on r6xx-SIAlex Deucher
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon: improve mc_stop/mc_resume on r5xx-r7xxAlex Deucher
Along the same lines of what was done for evergreen+ in the last kernel. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon: fix amd afusion gpu setup aka sumo v2Jerome Glisse
Set the proper number of tile pipe that should be a multiple of pipe depending on the number of se engine. Fix: https://bugs.freedesktop.org/show_bug.cgi?id=56405 https://bugs.freedesktop.org/show_bug.cgi?id=56720 v2: Don't change sumo2 Signed-off-by: Jerome Glisse <jglisse@redhat.com> Cc: stable@vger.kernel.org Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-12drm/radeon: do not move bo to different placement at each csJerome Glisse
The bo creation placement is where the bo will be. Instead of trying to move bo at each command stream let this work to another worker thread that will use more advance heuristic. agd5f: remove leftover unused variable Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
2012-12-11drm/i915: Fix shifted screen on top of LVDS on IVY laptopTakashi Iwai
The commit [23670b322: drm/i915: CPT+ pch transcoder workaround] caused a regression on some HP laptops with IvyBridge. The whole laptop screen is shifted downward for a few pixels constantly. The problem appears only on LVDS while DP and VGA seem unaffected. Also, the problem disappears once when go and back from S3. (S4 resume still shows the same problem.) This patch revives the minimum part the commit above dropped. For fixing this regression, only the setup of CHICKEN2 bit in cpt_init_clock_gating() is needed. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>