Jerome Glisse [Mon, 17 Dec 2012 15:29:06 +0000 (10:29 -0500)]
drm/radeon: don't leave fence blocked process on failed GPU reset
Force all fence to signal if GPU reset failed so no process get stuck
on waiting fence.
Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Dave Airlie [Sun, 16 Dec 2012 06:05:03 +0000 (06:05 +0000)]
Merge branch 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel into drm-next
Daniel writes:
A few leftover fixes for 3.8:
- VIC support for hdmi infoframes with the associated drm helper, fixes
some black TVs (Paulo Zanoni)
- Modeset state check (and fixup if the BIOS messed with the hw) for
lid-open. modeset-rework fallout. Somehow the original reporter went
awol, so this stalled for way too long until we've found a new
victim^Wreporter with broken BIOS.
- seqno wrap fixes from Mika and Chris.
- Some minor fixes all over from various people.
- Another race fix in the pageflip vs. unpin code from Chris.
- hsw vga resume support and a few more fdi link fixes (only used for vga
on hsw) from Paulo.
- Regression fix for DMAR from Zhenyu Wang - I've scavenged memory from my
DMAR for a while and it broke right away :(
- Regression fix from Takashi Iwai for ivb lvds - some w/a needs to be
(partially) moved back into place. Note that these are regressions in
-next.
- One more fix for ivb 3 pipe support - it now actually seems to work.
* 'drm-intel-fixes' of git://people.freedesktop.org/~danvet/drm-intel: (25 commits)
drm/i915: Fix missed needs_dmar setting
drm/i915: Fix shifted screen on top of LVDS on IVY laptop
drm/i915: disable cpt phase pointer fdi rx workaround
drm/i915: set the LPT FDI RX polarity reversal bit when needed
drm/i915: add lpt_init_pch_refclk
drm/i915: add support for mPHY destination on intel_sbi_{read, write}
drm/i915: reject modes the LPT FDI receiver can't handle
drm/i915: fix hsw_fdi_link_train "retry" code
drm/i915: Close race between processing unpin task and queueing the flip
drm/i915: fixup l3 parity sysfs access check
drm/i915: Clear the existing watermarks for g4x when modifying the cursor sr
drm/i915: do not access BLC_PWM_CTL2 on pre-gen4 hardware
drm/i915: Don't allow ring tail to reach the same cacheline as head
drm/i915: Decouple the object from the unbound list before freeing pages
drm/i915: Set sync_seqno properly after seqno wrap
drm/i915: Include the last semaphore sync point in the error-state
drm/i915: Rearrange code to only have a single method for waiting upon the ring
drm/i915: Simplify flushing activity on the ring
drm/i915: Preallocate next seqno before touching the ring
drm/i915: force restore on lid open
...
Dave Airlie [Sun, 16 Dec 2012 05:49:46 +0000 (05:49 +0000)]
Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
Inki writes:
"- add dmabuf attach/detach feature
. This patch would resolve performance deterioration issue
when v4l2-based driver is using the buffer imported from gem.
- drm/exynos: use DMA_ATTR_NO_KERNEL_MAPPING attribute
. With gem allocation, kernel space mapping isn't allocated and
also physical pages aren't mapped with the kernel space.
The physical pages are mapped with kernel space though vmap
function only for console framebuffer.
- add the below two patches I missed.
drm: exynos: moved exynos drm device registration to drm driver
drm: exynos: moved exynos drm hdmi device registration to drm driver
- add IPP subsystem framework and its-based device drivers.
. This patch set includes fimc, rotator and gsc drivers to perform
image scaling, rotation and color space conversion.
- add runtime pm support to hdmi driver.
- And fixups and cleanups."
* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (30 commits)
drm/exynos: add gsc ipp driver
drm/exynos: add rotator ipp driver
drm/exynos: add fimc ipp driver
drm/exynos: add iommu support for ipp
drm/exynos: add ipp subsystem
drm/exynos: support device tree for fimd
drm/exynos: support extended screen coordinate of fimd
drm/exynos: fix x, y coordinates for right bottom pixel
drm/exynos: fix fb offset calculation for plane
drm/exynos: hdmi: Fix potential NULL pointer dereference error
drm/exynos: hdmi: Add CONFIG_OF and use of_match_ptr() macro
drm/exynos: add support for hdmiphy power control for exynos5
drm/exynos: add runtime pm support for mixer
drm/exynos: added runtime pm support for hdmi
drm/exynos: fix allocation and cache mapping type
drm/exynos: reorder framebuffer init sequence
drm/exynos/iommu: fix return value check in drm_create_iommu_mapping()
drm/exynos: remove unused vaddr member
drm/exynos: use DMA_ATTR_NO_KERNEL_MAPPING attribute
drm/exynos: add exception codes to exynos_drm_fbdev_create()
...
Dave Airlie [Sat, 15 Dec 2012 22:15:18 +0000 (22:15 +0000)]
Merge branch 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
Fix regression, and some locking races, also as CS support
for the DMA engines.
* 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux:
radeon: fix regression with eviction since evict caching changes
drm/radeon: add more pedantic checks in the CP DMA checker
drm/radeon: bump version for CS ioctl support for async DMA
drm/radeon: enable the async DMA rings in the CS ioctl
drm/radeon: add VM CS parser support for async DMA on cayman/TN/SI
drm/radeon/kms: add evergreen/cayman CS parser for async DMA (v2)
drm/radeon/kms: add 6xx/7xx CS parser for async DMA (v2)
drm/radeon: fix htile buffer size computation for command stream checker
drm/radeon: fix fence locking in the pageflip callback
drm/radeon: make indirect register access concurrency-safe
drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss
Eunchul Kim [Fri, 14 Dec 2012 08:58:57 +0000 (17:58 +0900)]
drm/exynos: add gsc ipp driver
This patch adds IPP subsystem-based gsc driver for exynos5 series.
GSC is stand for General SCaler and supports the following features:
- image scaler/rotator/crop/flip/csc and input/output DMA operations.
- image rotation and image effect functions.
- writeback and display output operations.
- M2M operation to crop, scale, rotation and csc.
The below is GSC hardware path:
Memory------->GSC------>Memory
FIMD--------->GSC------>HDMI
FIMD--------->GSC------>Memory
Memory------->GSC------>FIMD, Mixer
This driver is registered to IPP subsystem framework to be used by user side
and user can control the GSC hardware through some interfaces of IPP subsystem
framework.
Eunchul Kim [Fri, 14 Dec 2012 08:58:56 +0000 (17:58 +0900)]
drm/exynos: add rotator ipp driver
This patch adds IPP subsystem-based rotator driver.
And Rotator supports the following features.
- Image crop operation support.
- Rotate operation support to 90, 180 or 270 degree.
- Flip operation support to vertical, horizontal or both.
. as limitaions, the pixel format to source buffer should be
same as the one to destination buffer and no scaler.
This driver is registered to IPP subsystem framework to be used by user side
and user can control the Rotator hardware through some interfaces of IPP
subsystem framework.
Eunchul Kim [Fri, 14 Dec 2012 08:58:55 +0000 (17:58 +0900)]
drm/exynos: add fimc ipp driver
FIMC is stand for Fully Interfactive Mobile Camera and
supports image scaler/rotator/crop/flip/csc and input/output DMA operations
and also supports writeback and display output operations.
This driver is registered to IPP subsystem framework to be used by user side
and user can control the FIMC hardware through some interfaces of IPP subsystem
framework.
Eunchul Kim [Fri, 14 Dec 2012 08:58:54 +0000 (17:58 +0900)]
drm/exynos: add iommu support for ipp
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>
Eunchul Kim [Fri, 14 Dec 2012 09:10:31 +0000 (18:10 +0900)]
drm/exynos: add ipp subsystem
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
Alex Deucher [Thu, 13 Dec 2012 17:27:28 +0000 (12:27 -0500)]
drm/radeon: enable the async DMA rings in the CS ioctl
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>
Alex Deucher [Thu, 13 Dec 2012 14:55:45 +0000 (09:55 -0500)]
drm/radeon/kms: add evergreen/cayman CS parser for async DMA (v2)
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>
Alex Deucher [Fri, 18 Nov 2011 15:19:47 +0000 (10:19 -0500)]
drm/radeon/kms: add 6xx/7xx CS parser for async DMA (v2)
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>
Daniel Vetter [Sun, 2 Dec 2012 13:06:15 +0000 (14:06 +0100)]
drm/radeon: make indirect register access concurrency-safe
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>
Daniel Vetter [Sun, 2 Dec 2012 13:02:51 +0000 (14:02 +0100)]
drm/radeon: add W|RREG32_IDX for MM_INDEX|DATA based mmio accesss
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>
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'.
Rahul Sharma [Wed, 28 Nov 2012 06:00:25 +0000 (11:30 +0530)]
drm/exynos: add support for hdmiphy power control for exynos5
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.
Inki Dae [Fri, 14 Dec 2012 05:34:31 +0000 (14:34 +0900)]
drm/exynos: fix allocation and cache mapping type
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>
Daniel Vetter [Fri, 14 Dec 2012 04:39:03 +0000 (13:39 +0900)]
drm/exynos: reorder framebuffer init sequence
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>
Zhenyu Wang [Thu, 13 Dec 2012 15:47:47 +0000 (23:47 +0800)]
drm/i915: Fix missed needs_dmar setting
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>
Wei Yongjun [Mon, 10 Dec 2012 07:11:13 +0000 (02:11 -0500)]
drm/exynos/iommu: fix return value check in drm_create_iommu_mapping()
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().
Inki Dae [Fri, 7 Dec 2012 08:51:27 +0000 (17:51 +0900)]
drm/exynos: use DMA_ATTR_NO_KERNEL_MAPPING attribute
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>
Prathyush K [Thu, 6 Dec 2012 14:46:06 +0000 (20:16 +0530)]
drm/exynos: clear windows in fimd dpms off
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>
Prathyush K [Thu, 6 Dec 2012 14:46:05 +0000 (20:16 +0530)]
drm/exynos: clear windows in mixer dpms off
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>
Prathyush K [Thu, 6 Dec 2012 14:46:04 +0000 (20:16 +0530)]
drm/exynos: modify wait_for_vblank of fimd
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>
Prathyush K [Thu, 6 Dec 2012 14:46:03 +0000 (20:16 +0530)]
drm/exynos: modify wait_for_vblank of mixer
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>
Prathyush K [Thu, 6 Dec 2012 14:46:00 +0000 (20:16 +0530)]
drm/exynos: make wait_for_vblank a manager op
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>
Inki Dae [Wed, 28 Nov 2012 10:09:31 +0000 (19:09 +0900)]
drm/exynos: add dmabuf attach/detach callbacks.
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>
Rahul Sharma [Tue, 16 Oct 2012 00:20:13 +0000 (05:50 +0530)]
drm: exynos: moved exynos drm hdmi device registration to drm driver
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.
Rahul Sharma [Tue, 16 Oct 2012 00:20:12 +0000 (05:50 +0530)]
drm: exynos: moved exynos drm device registration to drm driver
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.
Dave Airlie [Thu, 13 Dec 2012 02:03:22 +0000 (12:03 +1000)]
Merge branch 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
* 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux:
drm/radeon: fix fence driver for dma ring when wb is disabled
drm/radeon/si: add VM CS checker support for CP DMA
drm/radeon/cayman: add VM CS checker support for CP DMA
drm/radeon: add support for CP DMA packet to evergreen CS checker
drm/radeon: add support for CP DMA packet to r6xx/r7xx CS checker
drm/radeon: add register headers for CP DMA on r6xx-SI
drm/radeon: improve mc_stop/mc_resume on r5xx-r7xx
drm/radeon: fix amd afusion gpu setup aka sumo v2
drm/radeon: do not move bo to different placement at each cs
Jerome Glisse [Wed, 12 Dec 2012 21:43:15 +0000 (16:43 -0500)]
drm/radeon: fix fence driver for dma ring when wb is disabled
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>
Jerome Glisse [Thu, 29 Nov 2012 15:35:41 +0000 (10:35 -0500)]
drm/radeon: do not move bo to different placement at each cs
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>
Takashi Iwai [Tue, 11 Dec 2012 10:46:29 +0000 (11:46 +0100)]
drm/i915: Fix shifted screen on top of LVDS on IVY laptop
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>
Dave Airlie [Mon, 10 Dec 2012 22:46:03 +0000 (08:46 +1000)]
Merge branch 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
Alex writes:
"adds support for the
asynchronous DMA engines on r6xx-SI. These engines are used
for ttm bo moves and VM page table updates currently. They
could also be exposed via the CS ioctl for userspace use,
but I haven't had a chance to add proper CS checker patches
for them yet. These patches have been tested extensively
internally for months, so they should be pretty solid."
* 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux:
drm/radeon: use DMA engine for VM page table updates on SI
drm/radeon: add dma engine support for vm pt updates on si (v2)
drm/radeon: use DMA engine for VM page table updates on cayman/TN
drm/radeon: add dma engine support for vm pt updates on ni (v5)
drm/radeon: use async dma for ttm buffer moves on 6xx-SI
drm/radeon/kms: add support for dma rings to radeon_test_moves()
drm/radeon/kms: Add initial support for async DMA on SI
drm/radeon/kms: Add initial support for async DMA on cayman/TN
drm/radeon/kms: Add initial support for async DMA on evergreen
drm/radeon/kms: Add initial support for async DMA on r6xx/r7xx
Alex Deucher [Tue, 4 Dec 2012 20:27:33 +0000 (15:27 -0500)]
drm/radeon/kms: Add initial support for async DMA on cayman/TN
There are 2 async DMA engines on cayman, one at 0xd000 and
one at 0xd800. The programming interface is the same as
evergreen however there are some changes to the commands
for using vmids.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drm/i915: set phase sync pointer override enable before setting phase sync pointer
It turns out that this w/a isn't actually required on cpt/ppt and
positively harmful on ivb/ppt when using fdi B/C links - it results in
a black screen occasionally, with seemingfully everything working as
it should. The only failure indication I've found in the hw is that
eventually (but not right after the modeset completes) a pipe underrun
is signalled.
Big thanks to Arthur Runyan for all the ideas for registers to check
and changes to test, otherwise I couldn't ever have tracked this down!
Cc: "Runyan, Arthur J" <arthur.j.runyan@intel.com> Cc: stable@vger.kernel.org Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
All items on the lru list are always reservable, so this is a stupid
thing to keep. Not only that, it is used in a way which would
guarantee deadlocks if it were ever to be set to block on reserve.
This is a lot of churn, but mostly because of the removal of the
argument which can be nested arbitrarily deeply in many places.
No change of code in this patch except removal of the no_wait_reserve
argument, the previous patch removed the use of no_wait_reserve.
v2:
- Warn if -EBUSY is returned on reservation, all objects on the list
should be reservable. Adjusted patch slightly due to conflicts.
v3:
- Focus on no_wait_reserve removal only.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
drm/ttm: cope with reserved buffers on lru list in ttm_mem_evict_first, v2
Replace the goto loop with a simple for each loop, and only run the
delayed destroy cleanup if we can reserve the buffer first.
No race occurs, since lru lock is never dropped any more. An empty list
and a list full of unreservable buffers both cause -EBUSY to be returned,
which is identical to the previous situation, because previously buffers
on the lru list were always guaranteed to be reservable.
This should work since currently ttm guarantees items on the lru are
always reservable, and reserving items blockingly with some bo held
are enough to cause you to run into a deadlock.
Currently this is not a concern since removal off the lru list and
reservations are always done with atomically, but when this guarantee
no longer holds, we have to handle this situation or end up with
possible deadlocks.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
drm/ttm: cope with reserved buffers on swap list in ttm_bo_swapout, v2
Replace the while loop with a simple for each loop, and only run the
delayed destroy cleanup if we can reserve the buffer first.
No race occurs, since lru lock is never dropped any more. An empty list
and a list full of unreservable buffers both cause -EBUSY to be returned,
which is identical to the previous situation.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
drm/ttm: call ttm_bo_cleanup_refs with reservation and lru lock held, v3
By removing the unlocking of lru and retaking it immediately, a race is
removed where the bo is taken off the swap list or the lru list between
the unlock and relock. As such the cleanup_refs code can be simplified,
it will attempt to call ttm_bo_wait non-blockingly, and if it fails
it will drop the locks and perform a blocking wait, or return an error
if no_wait_gpu was set.
The need for looping is also eliminated, since swapout and evict_mem_first
will always follow the destruction path, no new fence is allowed
to be attached. As far as I can see this may already have been the case,
but the unlocking / relocking required a complicated loop to deal with
re-reservation.
Changes since v1:
- Simplify no_wait_gpu case by folding it in with empty ddestroy.
- Hold a reservation while calling ttm_bo_cleanup_memtype_use again.
Changes since v2:
- Do not remove bo from lru list while waiting
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Paulo Zanoni [Sat, 1 Dec 2012 14:04:26 +0000 (12:04 -0200)]
drm/i915: set the LPT FDI RX polarity reversal bit when needed
If we fail to set the bit when needed we get some nice FDI link
training failures (AKA "black screen on VGA output").
While we don't really know how to properly choose whether we need to
set the bit or not (VBT?), just read the initial value set by the BIOS
and store it for later usage.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Paulo Zanoni [Sat, 1 Dec 2012 14:04:25 +0000 (12:04 -0200)]
drm/i915: add lpt_init_pch_refclk
We need this code to init the PCH SSC refclk and the FDI registers.
The BIOS does this too and that's why VGA worked before this patch,
until you tried to suspend the machine...
This patch implements the "Sequence to enable CLKOUT_DP for FDI usage
and configure PCH FDI/IO" from our documentation.
v2:
- Squash Damien Lespiau's reset spelling fix on top.
- Add a comment that we don't need to bother about the ULT special
case Damien noticed, since ULT won't have VGA.
- Add a comment to rip out the SDV codepaths once haswell ships for
real.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> (v1) Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drm/radeon: allow move_notify to be called without reservation
The few places that care should have those checks instead.
This allows destruction of bo backed memory without a reservation.
It's required for being able to rework the delayed destroy path,
as it is no longer guaranteed to hold a reservation before unlocking.
However any previous wait is still guaranteed to complete, and it's
one of the last things to be done before the buffer object is freed.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This requires changing the order in ttm_bo_cleanup_refs_or_queue to
take the reservation first, as there is otherwise no race free way to
take lru lock before fence_lock.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Dave Airlie [Sat, 8 Dec 2012 03:17:07 +0000 (13:17 +1000)]
Merge branch 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux into drm-next
Alex writes:
Pretty minor -next pull request. We some additional new bits waiting
internally for release. Hopefully Monday we can get at least some of
them out. The others will probably take a few more weeks.
Highlights of the current request:
- ELD registers for passing audio information to the sound hardware
- Handle GPUVM page faults more gracefully
- Misc fixes
Merge radeon test
* 'drm-next-3.8' of git://people.freedesktop.org/~agd5f/linux: (483 commits)
drm/radeon: bump driver version for new info ioctl requests
drm/radeon: fix eDP clk and lane setup for scaled modes
drm/radeon: add new INFO ioctl requests
drm/radeon/dce32+: use fractional fb dividers for high clocks
drm/radeon: use cached memory when evicting for vram on non agp
drm/radeon: add a CS flag END_OF_FRAME
drm/radeon: stop page faults from hanging the system (v2)
drm/radeon/dce4/5: add registers for ELD handling
drm/radeon/dce3.2: add registers for ELD handling
radeon: fix pll/ctrc mapping on dce2 and dce3 hardware
Linux 3.7-rc7
powerpc/eeh: Do not invalidate PE properly
Revert "drm/i915: enable rc6 on ilk again"
ALSA: hda - Fix build without CONFIG_PM
of/address: sparc: Declare of_iomap as an extern function for sparc again
PM / QoS: fix wrong error-checking condition
bnx2x: remove redundant warning log
vxlan: fix command usage in its doc
8139cp: revert "set ring address before enabling receiver"
MPI: Fix compilation on MIPS with GCC 4.4 and newer
...
Paulo Zanoni [Sat, 1 Dec 2012 14:04:24 +0000 (12:04 -0200)]
drm/i915: add support for mPHY destination on intel_sbi_{read, write}
This way we should be able to write mPHY registers using the Sideband
Interface in the next commit. Also fixed some syntax oddities in the
related code.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Paulo Zanoni [Thu, 29 Nov 2012 13:29:31 +0000 (11:29 -0200)]
drm/i915: fix hsw_fdi_link_train "retry" code
We were previously doing exactly what the "mode set sequence for CRT"
document mandates, but whenever we failed to train the link in the
first tentative, all the other subsequent retries always failed. In
one of my monitors that has 47 modes, I was usually getting around 3
failures when running "testdisplay -a".
After this patch, even if we fail in the first tentative, we can
succeed in the next ones. So now when running "testdisplay -a" I see
around 3 times the message "FDI link training done on step 1" and no
failures.
Notice that now the "retry" code looks a lot like the DP retry code.
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Alex Deucher [Tue, 4 Dec 2012 17:55:37 +0000 (12:55 -0500)]
drm/radeon: add new INFO ioctl requests
Add requests to get the number of shader engines (SE) and
the number of SH per SE. These are needed for geometry
and tesselation shaders in the 3D driver as well as setting
up PA_SC_RASTER_CONFIG on SI asics.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Jerome Glisse [Wed, 28 Nov 2012 18:47:55 +0000 (13:47 -0500)]
drm/radeon: use cached memory when evicting for vram on non agp
Force the use of cached memory when evicting from vram on non agp
hardware. Also force write combine on agp hw. This is to insure
the minimum cache type change when allocating memory and improving
memory eviction especialy on pci/pcie hw.
Christian König [Tue, 18 Sep 2012 19:30:44 +0000 (15:30 -0400)]
drm/radeon: stop page faults from hanging the system (v2)
Redirect invalid memory accesses to the default page
instead of locking up the memory controller. Also
enable the invalid memory access interrupts and
start spamming system log with it.
v2 (agd5f): fix up against 2 level PT changes
Signed-off-by: Christian König <deathsimple@vodafone.de> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Cc: stable@vger.kernel.org
Chris Wilson [Mon, 3 Dec 2012 11:36:30 +0000 (11:36 +0000)]
drm/i915: Close race between processing unpin task and queueing the flip
Before queuing the flip but crucially after attaching the unpin-work to
the crtc, we continue to setup the unpin-work. However, should the
hardware fire early, we see the connected unpin-work and queue the task.
The task then promptly runs and unpins the fb before we finish taking
the required references or even pinning it... Havoc.
To close the race, we use the flip-pending atomic to indicate when the
flip is finally setup and enqueued. So during the flip-done processing,
we can check more accurately whether the flip was expected.
v2: Add the appropriate mb() to ensure that the writes to the page-flip
worker are complete prior to marking it active and emitting the MI_FLIP.
On the read side, the mb should be enforced by the spinlocks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@vger.kernel.org
[danvet: Review the barriers a bit, we need a write barrier both
before and after updating ->pending. Similarly we need a read barrier
in the interrupt handler both before and after reading ->pending. With
well-ordered irqs only one barrier in each place should be required,
but since this patch explicitly sets out to combat spurious interrupts
with is staged activation of the unpin work we need to go full-bore on
the barriers, too. Discussed with Chris Wilson on irc and changes
acked by him.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Dave Airlie [Wed, 5 Dec 2012 19:53:10 +0000 (05:53 +1000)]
Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next
This patch set adds iommu support, userptr feature to g2d, minor fixups
and code cleanups.
And the iommu feature has dependency of the below patches related to
dma mapping framework.
This patch is used to allocate fully physically contiguous memory region.
- add sending AVI and AVI info frames.
. this adds some codes for composing AVI and AUI info frames
and send them every VSYNC for HDMI Certification.
- bug fix to previous pull request.
- add some code cleanup
* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (32 commits)
drm/exynos: sending AVI and AUI info frames
drm/exynos: Use devm_clk_get in exynos_drm_fimd.c
drm/exynos: Use devm_* APIs in exynos_hdmi.c
drm/exynos: Use devm_clk_get in exynos_mixer.c
drm/exynos: Fix potential NULL pointer dereference
drm/exynos: Use devm_clk_get in exynos_drm_g2d.c
drm/exynos: use sgt instead of pages for framebuffer address
drm: exynos: fix for loosing display mode header during mode adjustment
drm/exynos: fix memory leak to EDID block
drm/exynos: remove 'pages' and 'page_size' elements in exynos gem buffer
drm/exynos: add exynos drm specific fb_mmap function
drm/exynos: make sure that overlay data are updated
drm/exynos: add vm_ops to specific gem mmaper
drm/exynos: add userptr feature for g2d module
drm/exynos: remove unnecessary sg_alloc_table call
drm: exynos: fix for mapping of dma buffers
drm/exynos: remove EXYNOS_BO_NONCONTIG type checking.
drm/exynos: add iommu support for g2d
drm/exynos: add iommu support for hdmi driver
drm/exynos: add iommu support to fimd driver
...
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57441 Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Sachin Kamat [Mon, 26 Nov 2012 04:17:14 +0000 (09:47 +0530)]
drm/exynos: Use devm_clk_get in exynos_drm_fimd.c
devm_clk_get is device managed and makes error handling and exit code
simpler.
Also fixes an error related to returning 'ret' without initialising
with error code.