Skip to content

Commit d9fc1f3

Browse files
committed
drm/exynos: update FBIOGET_DMABUF for 5.15 kernel
1 parent 210dfaf commit d9fc1f3

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

drivers/gpu/drm/exynos/exynos_drm_fbdev.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,17 @@ static struct dma_buf *exynos_fb_get_dma_buf(struct fb_info *info)
7676
{
7777
struct dma_buf *buf = NULL;
7878
struct drm_fb_helper *helper = info->par;
79-
struct drm_device *dev = helper->dev;
8079
struct exynos_drm_fbdev *exynos_fbd = to_exynos_fbdev(helper);
8180
struct exynos_drm_gem *exynos_gem = exynos_fbd->exynos_gem;
81+
struct drm_gem_object *obj = &exynos_gem->base;
8282

83-
if(dev->driver->gem_prime_export) {
84-
buf = dev->driver->gem_prime_export(&exynos_gem->base, O_RDWR);
85-
if(buf) {
86-
drm_gem_object_get(&exynos_gem->base);
87-
}
88-
}
83+
if (obj->funcs && obj->funcs->export)
84+
buf = obj->funcs->export(obj, O_RDWR);
85+
else
86+
buf = drm_gem_prime_export(obj, O_RDWR);
87+
88+
if (!IS_ERR_OR_NULL(buf))
89+
drm_gem_object_get(obj);
8990

9091
return buf;
9192
}

0 commit comments

Comments
 (0)