On Friday 07 December 2001 2:09 am, Keith Whitwell wrote:
> What are the goals of your patch?  Is it a cleanup, or is there
> something deeper you hope to gain?

Yes, I should have made the goal clearer.   This section of the diff is 
the relevant piece:

--- linux+ia64/drivers/char/drm/drm_vm.h        Tue Nov 27 13:54:53 2001
+++ linux/drivers/char/drm/drm_vm.h     Thu Dec  6 10:57:39 2001
@@ -115,18 +115,7 @@
                  * Get the page, inc the use count, and return it
                  */
                offset = (baddr - agpmem->bound) >> PAGE_SHIFT;
-
-               /*
-                * This is bad.  What we really want to do here is unmask
-                * the GART table entry held in the agp_memory structure.
-                * There isn't a convenient way to call agp_bridge.unmask_
-                * memory from here, so hard code it for now.
-                */
-#if defined(__ia64__)
-               paddr = (agpmem->memory->memory[offset] & 0xffffff) << 12;
-#else
-               paddr = agpmem->memory->memory[offset] & 
dev->agp->page_mask;
-#endif
+               paddr = agpmem->memory->memory[offset];
                page = virt_to_page(__va(paddr));
                get_page(page);
 
Note that the computation of paddr is machine-dependent.  The existing 
code for __ia64__ (paddr = (agpmem->memory->memory[offset] & 0xffffff) << 
12) is specific to the Intel 460GX chipset.  I'm implementing support for 
an HP IA64 chipset, and our unmasking function is of course different from 
the 460's.

So, we either have to have chipset-specific code in DRM to compute paddr, 
or export an API from AGP/GART (the page_mask stuff is a simple start at 
this, but as you can see, is not general enough to describe all unmask 
operations), or try to remove the need for the unmasking completely.

This last is the avenue that I'm trying to pursue.  The unmask operation 
is chipset-dependent, and ideally would be encapsulated within the 
AGP/GART module.  I don't see any reason why the memory[] table needs to 
contain the "masked" values, so I simply put the unmasked values there 
(the unmodified physical addresses).

The place where the masked values are needed is when they are actually 
inserted in the GATT, the table read by the chipset.  Before my patch, the 
memory allocation functions apply the mask operation and put the result 
into memory[].  The functions that insert into the GATT just copied the 
values from memory[].  My patch changes things so that the memory 
allocation functions do not apply the mask, but rather put the unmodified 
physical addresses into memory[].  The GATT insertion functions then take 
the values from memory[], apply the mask operation, *then* put them into 
the GATT.

Make sense?

_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to