drm_device from another device driver? (was: Re: block device backed by DRM buffer object)

2015-09-23 Thread Steven Newbury
On Wed, 2015-09-23 at 23:41 +0200, Lukas Wunner wrote: > Hi, > > On Wed, Sep 23, 2015 at 08:37:48PM +, Steven Newbury wrote: > > I can't figure out how to get a pointer to the radeon_device struct > > for a specific card, or the parent drm_device from an external > > device > > driver. > > st

drm_device from another device driver? (was: Re: block device backed by DRM buffer object)

2015-09-23 Thread Lukas Wunner
Hi, On Wed, Sep 23, 2015 at 08:37:48PM +, Steven Newbury wrote: > I can't figure out how to get a pointer to the radeon_device struct > for a specific card, or the parent drm_device from an external device > driver. struct device -> struct drm_device: dev_get_drvdata() struct pci_dev -> struc

drm_device from another device driver? (was: Re: block device backed by DRM buffer object)

2015-09-23 Thread Steven Newbury
I've been reading up on the device model and studying kernel sources for the last couple of days, but I can't figure out how to get a pointer to the radeon_device struct for a specific card, or the parent drm_device from an external device driver. I imagine I somehow need to take a reference to

block device backed by DRM buffer object

2015-09-22 Thread Steven Newbury
On Mon, 2015-09-21 at 15:05 +0200, Christian König wrote: > In general a rather interesting idea and actually shouldn't be to > hard to implement. > > The crux is that allocating memory is device driver dependent, so > there isn't a general purpose API for doing so. > > Additional to that the CP

block device backed by DRM buffer object

2015-09-21 Thread Christian König
In general a rather interesting idea and actually shouldn't be to hard to implement. The crux is that allocating memory is device driver dependent, so there isn't a general purpose API for doing so. Additional to that the CPU invisible VRAM is only accessible by the GPU so you at least need to

block device backed by DRM buffer object

2015-09-21 Thread Steven Newbury
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-wi