On 6/29/05, Jon Smirl <[EMAIL PROTECTED]> wrote:
> drmAgpAlloc() allocs drm_agp_mem structures which track the agp
> allocs. I could change the map system to allow a single map to be
> paired with each struct drm_agp_mem.
> 
> The 2MB restricted you are using was allocated with a call to
> drmAgpAlloc(), right? You would then add a _RESTRICTED map which would
> bind to the struct drm_agp_mem and stop further maps. We need to a
> check to make sure a normal user can't free and reallocate a piece of
> AGP memory marked restricted.
> 
> The drivers would then be changed to alloc the various parts of AGP
> space instead of allocing one big chunk and carving it up. By allocing
> multiple pieces the master can set different privs on each piece.
> 
> Backwards compatibility is maintained since root can make any maps
> that it wants ignoring the one map per struct drm_agp_mem restriction.

A better scheme to do this might be to leave drmAddMap alone and
create a new DRM entry point drmAgpAllocMap(). drmAddMap() would
continue to be root only. drmAgpAllocMap() is derived from
drmAgpAlloc() but also builds a map entry spanning the agp space
allocated. It takes an additional parameter for the appropriate
DRM_MAP flags. drmAgpAllocMap() would be marked master-only, not
root-only.

I believe this would be a better approach than changing drmAddMap to
allow some maps to be added without root priv and others still needing
it. drmAgpAllocMap() already has all of the info it needs, it is easy
for it to make the map too.

-- 
Jon Smirl
[EMAIL PROTECTED]


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
--
_______________________________________________
Dri-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to