diff options
author | Dave Airlie <airlied@redhat.com> | 2009-06-30 16:55:26 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-07-02 14:43:01 +1000 |
commit | 1782ce28953184776c90eb1255208a3e0ad245f0 (patch) | |
tree | df4bdd3c4e1ff58a4890d29e3998506745954419 /src/radeon_legacy_memory.c | |
parent | ac4bd24a66c1bdda0293f770a3f891e2b88cc8ee (diff) |
radeon: add KMS support (still disabled)
This adds DRI2 + KMS + driver pixmaps support to the driver.
I've decided to just do a completely separate KMS driver file
instead of hacking the crap out of radeon_driver.c. So now
I do the KMS check in radeon_probe.c time and set the DDX
pointed up to a completely different set at this stage.
This avoids a lot of if (kms) type crap in the code at
the expense of making sure we make changes to both files
if necessary.
This code is still disabled in configure.ac as I broke EXA composite
rendering somehow in KMS mode
Diffstat (limited to 'src/radeon_legacy_memory.c')
-rw-r--r-- | src/radeon_legacy_memory.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/radeon_legacy_memory.c b/src/radeon_legacy_memory.c index 861fd979..02b95edc 100644 --- a/src/radeon_legacy_memory.c +++ b/src/radeon_legacy_memory.c @@ -21,6 +21,20 @@ radeon_legacy_allocate_memory(ScrnInfoPtr pScrn, RADEONInfoPtr info = RADEONPTR(pScrn); uint32_t offset = 0; +#ifdef XF86DRM_MODE + if (info->cs) { + struct radeon_bo *video_bo; + + video_bo = radeon_bo_open(info->bufmgr, 0, size, 4096, 0, 0); + + *mem_struct = video_bo; + + if (!video_bo) + return 0; + + return (uint32_t)-1; + } +#endif #ifdef USE_EXA if (info->useEXA) { ExaOffscreenArea *area = *mem_struct; @@ -94,6 +108,14 @@ radeon_legacy_free_memory(ScrnInfoPtr pScrn, void *mem_struct) { RADEONInfoPtr info = RADEONPTR(pScrn); + +#ifdef XF86DRM_MODE + if (info->cs) { + struct radeon_bo *bo = mem_struct; + radeon_bo_unref(bo); + return; + } +#endif #ifdef USE_EXA ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; |