mirror of
https://github.com/hardkernel/linux.git
synced 2026-04-02 19:23:01 +09:00
FROMLIST: drm/rockchip: add fb_dmabuf_export support
Add support for fb_dmabuf_export call, which is executed when ioctl
FBIOGET_DMABUF is called.
Change-Id: I13b753ae25d043835b1f4ffc20b5e233171d1096
Signed-off-by: Guillaume Tucker <guillaume.tucker@arm.com>
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
(am from 61062681c9)
This commit is contained in:
committed by
Tao Huang
parent
3cbf2deaa0
commit
6bc1d2e52d
@@ -33,6 +33,23 @@ static int rockchip_fbdev_mmap(struct fb_info *info,
|
||||
return rockchip_gem_mmap_buf(private->fbdev_bo, vma);
|
||||
}
|
||||
|
||||
static struct dma_buf *rockchip_fbdev_get_dma_buf(struct fb_info *info)
|
||||
{
|
||||
struct dma_buf *buf = NULL;
|
||||
struct drm_fb_helper *helper = info->par;
|
||||
struct rockchip_drm_private *private = helper->dev->dev_private;
|
||||
struct drm_device *dev = helper->dev;
|
||||
|
||||
if (dev->driver->gem_prime_export) {
|
||||
buf = dev->driver->gem_prime_export(dev, private->fbdev_bo,
|
||||
O_RDWR);
|
||||
if (buf)
|
||||
drm_gem_object_get(private->fbdev_bo);
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
static struct fb_ops rockchip_drm_fbdev_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
DRM_FB_HELPER_DEFAULT_OPS,
|
||||
@@ -40,6 +57,7 @@ static struct fb_ops rockchip_drm_fbdev_ops = {
|
||||
.fb_fillrect = drm_fb_helper_cfb_fillrect,
|
||||
.fb_copyarea = drm_fb_helper_cfb_copyarea,
|
||||
.fb_imageblit = drm_fb_helper_cfb_imageblit,
|
||||
.fb_dmabuf_export = rockchip_fbdev_get_dma_buf,
|
||||
};
|
||||
|
||||
static int rockchip_drm_fbdev_create(struct drm_fb_helper *helper,
|
||||
|
||||
Reference in New Issue
Block a user