Jon Smirl wrote:
On 6/28/05, Thomas Hellström <[EMAIL PROTECTED]> wrote:
Having thought a bit more about the SAREA problem, I'd like to see the
following solution:
1) AddMap returns an error if the flag CONTAINS_LOCK is not set. The
first SAREA otherwise for
backwards compatibility.
2) The device-specific code returns the number of possible SAREAS and
the size of each of them.
3) The first one (containing the lock) is created on init or on open for
backwards compatibility.
4) subsequent ones are requested and created by a new IOCTL taking the
sarea number as an argument. This IOCTL should be used also for future
user space access to the first sarea, since standard lookup will fail
if there are a number of SAREA maps greater than one. Refcount for
destruction of subsequent maps?
You can't let a normal user request an arbitrary number or size of
sarea. If the API allows general requests it has to be root only.
You got me wrong. Item 2 above states that the device specific code
specifies the number of possible SAREAS and their sizes to main DRM as
part of its initialization.
typically for two sareas something like
static uint32_t via_sarea_sizes[] = {8192, 4096, 0};
static struct drm_driver driver = {
.driver_features =
DRIVER_USE_AGP | DRIVER_USE_MTRR | DRIVER_HAVE_IRQ |
DRIVER_IRQ_SHARED | DRIVER_IRQ_VBL,
.context_ctor = via_init_context,
.context_dtor = via_final_context,
.vblank_wait = via_driver_vblank_wait,
.....
.sarea_sizes = via_sarea_sizes;
New user code can then get a handle to the first sarea by calling
(implementation of a new ioctl)
drmGetSAREA(0, &handle, &size);
drmGetSAREA(1, &handle, &size);
whereas drmGetSAREA(2,....) and upwards would fail in this case.
/Thomas
-------------------------------------------------------
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