On Thu, 2009-02-12 at 05:29 +0000, Dave Airlie wrote: > > So I have a goal to get a radeon driver that works on a bufmgr and that > then can be used on non-mm/mm, and also where I can make DRI2 and FBOs > work. > > So with that in mind and not wanting to write this 3 times, I've done a > major refactoring of the radeon/r200/r300 drivers. > > I've refactored all the: > buffer management, > buffer swap + copy, > texture and mipmap management, > command submission handling, > state + atom emission > dma buffers, > lock code, > > into common files for all 3 drivers, and re-used the same code in nearly > the same ways across all 3. > > So far I've been working on getting the legacy buffer/command code into > shape so I can merge this in place of the current drivers without > suffering any major regressions. Then start adding the code necessary for > DRI2/GEM/FBOs on top of it. I think this code is pretty close to read to > merge, I'd like people to bash on it, and report any major regressions > above the current r100/r200/r300 codebases with these drivers.
With the endianness fix below, it basically works for me. However, page flipping is broken, looks like it always renders to the same buffer regardless of which one is being displayed. With gliv, I got quite broken rendering (though that could just be due to the page flipping issues), several different error messages from the 3D driver and eventually a lockup (so unfortunately I lost the error messages). So I'm not sure it's quite ready to merge yet, but I have to say it's amazing what you guys have achieved. :) >From c4014baa4c8593f98e176af25590c99898b235ca Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Michel=20D=C3=A4nzer?= <daen...@vmware.com> Date: Thu, 12 Feb 2009 10:08:47 +0100 Subject: r300: Fix R300_CMD_SCRATCH on big endian. --- src/mesa/drivers/dri/radeon/radeon_cs_drm.h | 10 ++++++++++ src/mesa/drivers/dri/radeon/radeon_cs_legacy.c | 3 +-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_drm.h b/src/mesa/drivers/dri/radeon/radeon_cs_drm.h index 8f0b449..6cc9daa 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_drm.h +++ b/src/mesa/drivers/dri/radeon/radeon_cs_drm.h @@ -33,6 +33,7 @@ #define RADEON_CS_H #include <stdint.h> +#include "main/imports.h" #include "drm.h" #include "radeon_drm.h" @@ -194,4 +195,13 @@ static inline void radeon_cs_write_dword(struct radeon_cs *cs, uint32_t dword) } } +static inline void radeon_cs_write_qword(struct radeon_cs *cs, uint64_t qword) +{ + _mesa_memcpy(cs->packets + cs->cdw, &qword, sizeof(qword)); + cs->cdw += 2; + if (cs->section) { + cs->section_cdw += 2; + } +} + #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index 0f73dec..aa95d86 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -288,8 +288,7 @@ static int cs_emit(struct radeon_cs *cs) age.scratch.n_bufs = 1; age.scratch.flags = 0; radeon_cs_write_dword(cs, age.u); - radeon_cs_write_dword(cs, ull & 0xffffffff); - radeon_cs_write_dword(cs, ull >> 32); + radeon_cs_write_qword(cs, ull); radeon_cs_write_dword(cs, 0); } -- 1.6.1.2 -- Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer ------------------------------------------------------------------------------ Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM) software. With Adobe AIR, Ajax developers can use existing skills and code to build responsive, highly engaging applications that combine the power of local resources and data with the reach of the web. Download the Adobe AIR SDK and Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com -- _______________________________________________ Dri-devel mailing list Dri-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dri-devel