On Sat, 13 Oct 2001 17:32, [EMAIL PROTECTED] wrote: > On Sat, 13 Oct 2001, Keith Whitwell wrote: > > > That's what I am trying to do. With not much luck so far. The reason > > > (at least to me) is that the 3d driver is the interaction of 3 parts: > > > kernel drm module, XFree driver (like radeon_dri.c) and the dri part > > > (whatever goes into radeon_dri.so). > > > > > > > Second, it is easiest to answer your questions if you refer to > > > > specific lines in specific files. There is no variable called "AGP > > > > Offset" anywhere in the drm. Maybe there are some with similar > > > > names, but I can't tell which one you're talking about. > > > > > > Finally, someone who knows the stuff :)) No, there is no such variable, > > > but this phrase I plucked from the comment. Here is an example from > > > radeon.h: > > > > > > /* CP vertex/indirect buffer data */ > > > unsigned long bufStart; /* Offset into AGP space */ > > > drmHandle bufHandle; /* Handle from drmAddMap */ > > > drmSize bufMapSize; /* Size of map */ > > > int bufSize; /* Size of buffers (in MB) */ > > > unsigned char *buf; /* Map */ > > > int bufNumBufs; /* Number of buffers */ > > > drmBufMapPtr buffers; /* Buffer map */ > > > > > > Now, from these I guess that *buf is where I can access the data > > > directly for Xserver. bufSize is the size of the thing - does it have > > > to be in MB ? > > > > It is interpreted as mb, hence the comment. > > Yes, I know _that_. Does it _have_ to be in mb ? can I change it to be in > pages and multiply every occurence by (1024*1024/PAGE_SIZE) ? In there > there a reason to have it in MB (aside from printing nice round numbers > during startup) ?
No, it's just the convention that Kevin or whoever used when writing that driver. It could as easily be in bytes or pages or whatever you like, so long as everyone using it understands. Eventually it gets passed to drmMap, which expect bytes, I think. > > > > Or just page-aligned is fine ? bufStart - what do I use this for ? Can > > > I use it to reference data in the buffer or do I have to add or > > > subtract a magic number from it before writing into card's registers ? > > > > This is an offset from the start of the agp apperture. > > Do you know which value is used in drivers ? Offset itself or offset + > start ? Also, the AGP registers are set to translate the entire address > space - is this the AGP aperture ? Or is it something else ? The drivers map these spaces with drmMap, so they see each map as starting at some virtual address. When the drivers talk to the kernel it's handled on a case by case basis - as long as the driver and the kernel agree on the interpretation then everythings ok - but there's no hard and fast rule. Often for dma buffers, the communication is in terms of 'buffer index' which neither of these. I think that your problem is that you're looking for a global rule when really there are just lots of individual cases. The driver can use whatever it likes so long as the code in the kernel knows what it's talking about. These fields are just a communication between 2d driver and 3d driver. However, most of the values that you are interested in are eventually passed to drmMap and drmAddMap which have defined interfaces. If you are confused about a particular field, looking at how it is passed to drmMap/AddMap will disambiguate it to a large degree. Keith _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel