2001-12-07 13:32:20

by Abraham vd Merwe

[permalink] [raw]
Subject: agpgart & i810 & agp_bridge.gatt_table question

Hi!

What is agp_bridge.gatt_table used for on the Intel 810 series?

Looking at agpgart_be.c, it seems either 64k or 32k is allocated (depending
on the value of MISCC register) and all the entries is set to the scratch
page for i810, but that gatt table is never used except in
intel_i810_insert_entries() where we have this check:

------------< snip <------< snip <------< snip <------------
for (j = pg_start; j < (pg_start + mem->page_count); j++) {
if (!PGE_EMPTY(agp_bridge.gatt_table[j])) {
return -EBUSY;
}
------------< snip <------< snip <------< snip <------------

!PGE_EMPTY roughly translates to agp_bridge.gatt_table[j] &&
agp_bridge.gatt_table[j] != agp_bridge.scratch_page.

Of course, this is always true, so we'll never return EBUSY there, but the
whole thing is silly because we're wasting precious 64k/32k physical
contigious ram and valuable CPU time for this useless check...

The other odd thing I noticed is that this gatt_table is initialized in
agp_backend_initialize(). Look at the 'if (agp_bridge.create_gatt_table()) {'
line in that function. For i810 this translates to
agp_generic_create_gatt_table(), which goes and queries
agp_bridge.current_size.

The problem is that at that stage agp_bridge.current is not initialized yet,
so we're going to get bogus sizes. (Note: this doesn't only go for i810, but
for any chipset that uses agp_generic_create_gatt_table and doesn't have a
size type LVL2_APER_SIZE (for which that function doesn't work))

--

Regards
Abraham

Experience is what you get when you were expecting something else.

__________________________________________________________
Abraham vd Merwe - 2d3D, Inc.

Device Driver Development, Outsourcing, Embedded Systems

Cell: +27 82 565 4451 Snailmail:
Tel: +27 21 761 7549 Block C, Antree Park
Fax: +27 21 761 7648 Doncaster Road
Email: [email protected] Kenilworth, 7700
Http: http://www.2d3d.com South Africa


Attachments:
(No filename) (1.96 kB)
(No filename) (232.00 B)
Download all attachments