All of lore.kernel.org
 help / color / mirror / Atom feed
* block device backed by DRM buffer object
@ 2015-09-21 11:33 Steven Newbury
  2015-09-21 13:05 ` Christian König
  0 siblings, 1 reply; 7+ messages in thread
From: Steven Newbury @ 2015-09-21 11:33 UTC (permalink / raw)
  To: dri-devel


[-- Attachment #1.1: Type: text/plain, Size: 1761 bytes --]

I have a mostly* headless server containing a Radeon discrete GPU.  It
occured to me that having a GiB or two of high speed memory sitting
unused is pretty wasteful. Not an original thought; indeed there's a
Gentoo wiki which describes how to map the memory as a mtd device:
 
http://www.gentoo-wiki.info/TIP_Use_memory_on_video_card_as_swap

There's also a driver (cudaram) written by Piotr Jaroszyński which
allocates memory through CUDA and maps it to a block device:

http://blog.piotrj.org/2011/03/cudaram-block-device-exposing-nvidia.htm
l

The Gentoo method is extremely limited, and of course isn't exactly
safe, although using pci-stub would probably help.  There's no
arbitration between the DRM driver and the mtd phram driver.  Most of
all, it can only expose the memory mapped into the PCI aperture, likely
somewhat less than the full VMEM.

The second method obviously requires the proprietary NVidia driver and
an NVidia gfx card, but it's good proof of concept at utilising a
driver managed buffer object as a block device.

I'm looking into creating a volatile block device driver which
allocates VMEM from DRM, what if any is the right API to use?  The DRM
userspace API is well documented, but I'd like to make this a kernel
module, so using a userspace API would seem inappropriate at best.
 Ideally I'd like to create something like the bcache flash_vol_create
interface except expose a /sys/fs/drm-block/card0/vol_create (where
drm-block is a placeholder for the proposed driver name) for each DRM
device in the system, and likewise persistence through udev.

So is there an API I can (mis-)use for this?  Any suggestions?

* There's a screen attached for maintainence, but it usually turned
off.

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-09-24  9:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-21 11:33 block device backed by DRM buffer object Steven Newbury
2015-09-21 13:05 ` Christian König
2015-09-22 20:44   ` Steven Newbury
2015-09-23 20:37     ` drm_device from another device driver? (was: Re: block device backed by DRM buffer object) Steven Newbury
2015-09-23 21:41       ` Lukas Wunner
2015-09-23 22:52         ` Steven Newbury
2015-09-24  9:41           ` drm_device from another device driver? Christian König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.