|
@@ -59,11 +59,13 @@ __drm_gem_cma_create(struct drm_device *drm, size_t size)
|
|
|
struct drm_gem_object *gem_obj;
|
|
|
int ret;
|
|
|
|
|
|
- cma_obj = kzalloc(sizeof(*cma_obj), GFP_KERNEL);
|
|
|
- if (!cma_obj)
|
|
|
+ if (drm->driver->gem_create_object)
|
|
|
+ gem_obj = drm->driver->gem_create_object(drm, size);
|
|
|
+ else
|
|
|
+ gem_obj = kzalloc(sizeof(*cma_obj), GFP_KERNEL);
|
|
|
+ if (!gem_obj)
|
|
|
return ERR_PTR(-ENOMEM);
|
|
|
-
|
|
|
- gem_obj = &cma_obj->base;
|
|
|
+ cma_obj = container_of(gem_obj, struct drm_gem_cma_object, base);
|
|
|
|
|
|
ret = drm_gem_object_init(drm, gem_obj, size);
|
|
|
if (ret)
|