summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r600_blit_kms.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/radeon: use ALIGN instead of open coding itMatt Turner2010-03-011-2/+2
| | | | | | | | Cc: Jerome Glisse <jglisse@redhat.com> Cc: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Corbin Simpson <MostAwesomeDude@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: remove HDP flushes from fence emit (v2)Alex Deucher2010-02-181-2/+2
| | | | | | | | | r600_ioctl_wait_idle() now handles this. v2: update blit fence counts Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: fix indirect buffer management V2Jerome Glisse2010-02-161-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | There is 3 different distinct states for an indirect buffer (IB) : 1- free with no fence 2- free with a fence 3- non free (fence doesn't matter) Previous code mixed case 2 & 3 in a single one leading to possible catastrophique failure. This patch rework the handling and properly separate each case. So when you get ib we set the ib as non free and fence status doesn't matter. Fence become active (ie has a meaning for the ib code) once the ib is scheduled or free. This patch also get rid of the alloc bitmap as it was overkill, we know go through IB pool list like in a ring buffer as the oldest IB is the first one the will be free. Fix : https://bugs.freedesktop.org/show_bug.cgi?id=26438 and likely other bugs. V2 remove the scheduled list, it's useless now, fix free ib scanning Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/r600: reduce gpu cache flushingAlex Deucher2010-02-091-11/+2
| | | | | | | | | | | | | | Only flush the gpu caches before we submit a fence. This leads to a small performance boost when we take the extra gpu cache flushes out of the ddx and mesa. Once this patch is in and the drm version is bumped, we can remove the flushes from the ddx and drm. Also, remove the extra cache flushes from the blit routine. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Bailout of blit if error happen & protect with mutex V3Jerome Glisse2010-02-011-2/+5
| | | | | | | | | | | | | | | | | | | | If an error happen in r600_blit_prepare_copy report it rather than WARNING and keeping execution. For instance if ib allocation failed we did just warn about but then latter tried to access NULL ib ptr causing oops. This patch also protect r600_copy_blit with a mutex as otherwise one process might overwrite blit temporary data with new one possibly leading to GPU lockup. Should partialy or totaly fix: https://bugzilla.redhat.com/show_bug.cgi?id=553279 V2 failing blit initialization is not fatal, fallback to memcpy when this happen V3 init blit before startup as we pin in startup, remove duplicate code (this one was actualy tested unlike V2) Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Fix r600 blit cleanup pathJerome Glisse2010-01-141-6/+8
| | | | | | | | | r600 blit cleanup path need to check if a bo was allocated before trying to free or unpin it. This patch add this check and avoid oops when the initialization on r6xx or r7xx hw fails. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Schedule host path read cache flush through the ring V2Jerome Glisse2010-01-081-2/+2
| | | | | | | | | | | | | | | | | R300 family will hard lockup if host path read cache flush is done through MMIO to HOST_PATH_CNTL. But scheduling same flush through ring seems harmless. This patch remove the hdp_flush callback and add a flush after each fence emission which means a flush after each IB schedule. Thus we should have same behavior without the hard lockup. Tested on R100,R200,R300,R400,R500,R600,R700 family. V2: Adjust fence counts in r600_blit_prepare_copy() Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Rework radeon object handlingJerome Glisse2009-12-021-11/+19
| | | | | | | | | | | | | | | The locking & protection of radeon object was somewhat messy. This patch completely rework it to now use ttm reserve as a protection for the radeon object structure member. It also shrink down the various radeon object structure by removing field which were redondant with the ttm information. Last it converts few simple functions to inline which should with performances. airlied: rebase on top of r600 and other changes. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: Add support for interrupts on r6xx/r7xx chips (v3)Alex Deucher2009-12-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | This enables the use of interrupts on r6xx/r7xx hardware. Interrupts are implemented via a ring buffer. The GPU adds interrupts vectors to the ring and the host reads them off in the interrupt handler. The interrupt controller requires firmware like the CP. This firmware must be installed and accessble to the firmware loader for interrupts to function. MSIs don't seem to work on my RS780. They work fine on all my discrete cards. I'm not sure about other RS780s or RS880s. I've disabled MSIs on RS780 and RS880, but it would probably be worth checking on some other systems. v2 - fix some checkpatch.pl problems; re-read the disp int status reg if we restart the ih; v3 - remove the irq handler if r600_irq_init() fails; remove spinlock in r600_ih_ring_fini(); move ih rb overflow check to r600_get_ih_wptr(); move irq ack to separate function; Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/r600: fix rs880 support v2Alex Deucher2009-11-061-1/+1
| | | | | | | | | Lots of cases were wrong or missing. v2: rebased against drm-next Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon: Revert "drm/r600: avoid assigning vb twice in blit code"Dave Airlie2009-10-121-2/+1
| | | | | | | This reverts commit 49c458e544ae14514209ed80ea6829ca1b18ddf0. It seems to have some side effects in the non-kms cases. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/r600: avoid assigning vb twice in blit codeRobert Noland2009-10-081-1/+2
| | | | | | | | | There is no need to assign vb before you know that space is available. [agd5f: adapted for kernel tree.] Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/r600: set correct pitch for 4 byte copyAndre Maasikas2009-09-231-1/+1
| | | | | | [agd5f: also fix the non-kms path] Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
* drm/radeon/r600: fix some issues with suspend/resume.Dave Airlie2009-09-181-9/+2
| | | | | | | | | a) don't zero gart table on gart enable b) move pinning shader object into resume path c) unpin shader object on suspend d) set cp ready to false after cp shutdown on suspend. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/r600/kms: fixup number of loops per blit calculation.Dave Airlie2009-09-181-7/+14
| | | | | | | | | | | Some people were seeing *ERROR* radeon: writting more dword to ring than expected after certain blits, the loops calculation didn't take into account that we do a separate blit for the remainder after doing the aligned blits. Acked-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: IB locking dumps out a lockdep ordering issueDave Airlie2009-09-161-1/+1
| | | | | | | | | | We sometimes lock IB then the ring and sometimes the ring then the IB. This is mostly due to the IB locking not being well defined about what data in the structs it actually locks. Define what I believe is the correct behaviour and gets rid of the lock dep ordering warning. Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms/r600: fix blit dword count for non r6xxAlex Deucher2009-09-121-2/+7
| | | | | | | rv6xx emits two extra dwords in the render target setup. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@linux.ie>
* drm/radeon/kms/r600: fix blit supportAlex Deucher2009-09-101-8/+31
| | | | | | | | | | | | | select the correct max number of bytes per blit based on whether the size is multiple of 4 bytes. This determines whether we can use 8 or 32 bit pixels for the blit. airlied: also merged the IB padding patch + correcting the VS offset for context Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
* drm/radeon/kms: add r600 KMS supportJerome Glisse2009-09-081-0/+777
This adds the r600 KMS + CS support to the Linux kernel. The r600 TTM support is quite basic and still needs more work esp around using interrupts, but the polled fencing should work okay for now. Also currently TTM is using memcpy to do VRAM moves, the code is here to use a 3D blit to do this, but isn't fully debugged yet. Authors: Alex Deucher <alexdeucher@gmail.com> Dave Airlie <airlied@redhat.com> Jerome Glisse <jglisse@redhat.com> Signed-off-by: Jerome Glisse <jglisse@redhat.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
OpenPOWER on IntegriCloud