Re: [PATCH] drm/gem: add functions to get/put pages

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Sep 27, 2011 at 4:35 AM, Alan Cox <alan@xxxxxxxxxxxxxxxxxxx> wrote:
>> Well I think for this case the solution is simple: Tiling not allowed
>> if userspace is too dumb to properly round the buffer up so it
>> fulfills whatever odd requirement the hw has. I think hiding the fact
>> that certain buffers need more backing storage than a naive userspace
>> might assume is ripe for ugly problems down the road.
>
> That depends a lot upon the interface. One good reason for hiding it for
> example is that if you have hardware where a limit goes away (or worse
> yet appears) in some rev of the device or an erratum you don't have to
> issue a new X server.
>
> For some of the other interfaces like the dumb fb api it's even more
> important the code doesn't know.
>
> I don't however think the helper should know about padding because I
> think a driver can implement its own function which wraps the helper and
> then adds the padding itself ?


fwiw, Daniel convinced me to go a slightly different route, and keep
get/put_pages() as-is, but instead go with a variant of
drm_gem_create_mmap_offset() that takes a size parameter.. ie. roughly
like:

int drm_gem_create_mmap_offset(struct drm_gem_object *obj)
{
	return drm_gem_create_mmap_offset_size(obj, obj->size);
}
int drm_gem_create_mmap_offset_size(struct drm_gem_object *obj, size_t size)
{
...
}

I'll just call drm_gem_create_mmap_offset_size() directly, normal
drivers can just use drm_gem_create_mmap_offset().  That seems like it
should work..

BR,
-R

> Alan
> _______________________________________________
> dri-devel mailing list
> dri-devel@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux