diff options
author | Matthias Hopf <mhopf@suse.de> | 2009-02-20 21:07:50 +0100 |
---|---|---|
committer | Matthias Hopf <mhopf@suse.de> | 2009-02-24 17:32:20 +0100 |
commit | 0be7235d970daef26ace27538b4787479f8e4f01 (patch) | |
tree | 3f73fc860af104a311523ea7995fae6dbb426a68 | |
parent | 85991371ab9c174ecfa6d5f481a0d41cd59e9ca9 (diff) |
Try to better detect display width.
Still doesn't work as intended.
-rw-r--r-- | r600_demo.c | 14 | ||||
-rw-r--r-- | r600_reg_r6xx.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/r600_demo.c b/r600_demo.c index cb84d8c..e1f8fdf 100644 --- a/r600_demo.c +++ b/r600_demo.c @@ -66,7 +66,7 @@ volatile void *registers=NULL; void *framebuffer=NULL; int framebuffer_size=0; -int display_width, display_height; +int display_width, display_pitch, display_height; uint32_t display_gpu; // Should be 64bit, but is currently 32bit address in R6xx, R7xx chips /* DMA buffers */ @@ -471,11 +471,13 @@ void read_registers(void) fprintf (stderr, "Chipset: untested, #%d\n\n", adapter.chipset); } - display_width = reg_read32 (D1GRPH_PITCH); + display_width = reg_read32 (D1GRPH_X_END) - reg_read32 (D1GRPH_X_START); + display_pitch = reg_read32 (D1GRPH_PITCH); display_height = reg_read32 (D1GRPH_Y_END); display_gpu = reg_read32 (D1GRPH_PRIMARY_SURFACE_ADDRESS); if (verbose >= 2) { fprintf(stderr,"display_width=%d\n", display_width); + fprintf(stderr,"display_pitch=%d\n", display_pitch); fprintf(stderr,"display gpu: 0x%08x\n", display_gpu); } @@ -616,16 +618,16 @@ int main(int argc, char *argv[]) framebuffer, adapter.framebuffer_gpu); adapter.display_gpu = display_gpu; adapter.display = framebuffer + display_gpu - adapter.framebuffer_gpu; - adapter.display_pitch = display_width; + adapter.display_pitch = display_pitch; adapter.display_width = display_width; adapter.display_height = display_height; adapter.color_gpu = display_gpu; - adapter.color_pitch = display_width; + adapter.color_pitch = display_pitch; adapter.color_height = display_height; - adapter.depth_gpu = display_gpu + display_width*4*500; - adapter.depth_pitch = display_width; + adapter.depth_gpu = display_gpu + display_pitch*4*500; + adapter.depth_pitch = display_pitch; adapter.depth_height = 480; if (verbose >= 1) { diff --git a/r600_reg_r6xx.h b/r600_reg_r6xx.h index f7702c4..b2e72d2 100644 --- a/r600_reg_r6xx.h +++ b/r600_reg_r6xx.h @@ -84,6 +84,8 @@ enum { D1GRPH_PRIMARY_SURFACE_ADDRESS = 0x6110, D1GRPH_PITCH = 0x6120, + D1GRPH_X_START = 0x612c, + D1GRPH_X_END = 0x6134, D1GRPH_Y_END = 0x6138, GRBM_STATUS = 0x8010, |