aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/atombios_crtc.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-06-23 19:48:08 -0400
committerDave Airlie <airlied@redhat.com>2009-07-29 01:42:18 -0400
commite024e11070a0a0dc7163ce1ec2da354a638bdbed (patch)
treeadd483e7428f91da6f3c26be702aa45e6d69b694 /drivers/gpu/drm/radeon/atombios_crtc.c
parentc836e862803b2aa2bd9a354e151316d2b42c44ec (diff)
drm/radeon/kms: add initial colortiling support.
This adds new set/get tiling interfaces where the pitch and macro/micro tiling enables can be set. Along with a flag to decide if this object should have a surface when mapped. The only thing we need to allocate with a mapped surface should be the frontbuffer. Note rotate scanout shouldn't require one, and back/depth shouldn't either, though mesa needs some fixes. It fixes the TTM interfaces along Thomas's suggestions, and I've tested the surface stealing code with two X servers and not seen any lockdep issues. I've stopped tiling the fbcon frontbuffer, as I don't see there being any advantage other than testing, I've left the testing commands in there, just flip the fb_tiled to true in radeon_fb.c Open: Can we integrate endian swapping in with this? Future features: texture tiling - need to relocate texture registers TXOFFSET* with tiling info. This also merges Michel's cleanup surfaces regs at init time patch even though it makes sense on its own, this patch really relies on it. Some PowerMac firmwares set up a tiling surface at the beginning of VRAM which messes us up otherwise. that patch is: Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_crtc.c')
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index e64a199b5ee1..eac26cdb5dae 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -327,7 +327,7 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
327 struct drm_gem_object *obj; 327 struct drm_gem_object *obj;
328 struct drm_radeon_gem_object *obj_priv; 328 struct drm_radeon_gem_object *obj_priv;
329 uint64_t fb_location; 329 uint64_t fb_location;
330 uint32_t fb_format, fb_pitch_pixels; 330 uint32_t fb_format, fb_pitch_pixels, tiling_flags;
331 331
332 if (!crtc->fb) 332 if (!crtc->fb)
333 return -EINVAL; 333 return -EINVAL;
@@ -364,7 +364,14 @@ int atombios_crtc_set_base(struct drm_crtc *crtc, int x, int y,
364 return -EINVAL; 364 return -EINVAL;
365 } 365 }
366 366
367 /* TODO tiling */ 367 radeon_object_get_tiling_flags(obj->driver_private,
368 &tiling_flags, NULL);
369 if (tiling_flags & RADEON_TILING_MACRO)
370 fb_format |= AVIVO_D1GRPH_MACRO_ADDRESS_MODE;
371
372 if (tiling_flags & RADEON_TILING_MICRO)
373 fb_format |= AVIVO_D1GRPH_TILED;
374
368 if (radeon_crtc->crtc_id == 0) 375 if (radeon_crtc->crtc_id == 0)
369 WREG32(AVIVO_D1VGA_CONTROL, 0); 376 WREG32(AVIVO_D1VGA_CONTROL, 0);
370 else 377 else