0115-drm-Use-the-driver-s-gem_object_free-function-from-C.patch 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From 3f01cb691c249a57394e64523ba979aaf181f999 Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Fri, 11 Dec 2015 19:45:03 -0800
  4. Subject: [PATCH 115/381] drm: Use the driver's gem_object_free function from
  5. CMA helpers.
  6. VC4 wraps the CMA objects in its own structures, so it needs to do its
  7. own teardown (waiting for GPU to finish, updating bo_stats tracking).
  8. The other CMA drivers are using drm_gem_cma_free_object as their
  9. gem_free_object, so this should be a no-op for them.
  10. Signed-off-by: Eric Anholt <eric@anholt.net>
  11. ---
  12. drivers/gpu/drm/drm_fb_cma_helper.c | 6 +++---
  13. drivers/gpu/drm/drm_gem_cma_helper.c | 4 ++--
  14. 2 files changed, 5 insertions(+), 5 deletions(-)
  15. --- a/drivers/gpu/drm/drm_fb_cma_helper.c
  16. +++ b/drivers/gpu/drm/drm_fb_cma_helper.c
  17. @@ -266,7 +266,7 @@ static int drm_fbdev_cma_create(struct d
  18. fbi = drm_fb_helper_alloc_fbi(helper);
  19. if (IS_ERR(fbi)) {
  20. ret = PTR_ERR(fbi);
  21. - goto err_drm_gem_cma_free_object;
  22. + goto err_gem_free_object;
  23. }
  24. fbdev_cma->fb = drm_fb_cma_alloc(dev, &mode_cmd, &obj, 1);
  25. @@ -299,8 +299,8 @@ static int drm_fbdev_cma_create(struct d
  26. err_fb_info_destroy:
  27. drm_fb_helper_release_fbi(helper);
  28. -err_drm_gem_cma_free_object:
  29. - drm_gem_cma_free_object(&obj->base);
  30. +err_gem_free_object:
  31. + dev->driver->gem_free_object(&obj->base);
  32. return ret;
  33. }
  34. --- a/drivers/gpu/drm/drm_gem_cma_helper.c
  35. +++ b/drivers/gpu/drm/drm_gem_cma_helper.c
  36. @@ -121,7 +121,7 @@ struct drm_gem_cma_object *drm_gem_cma_c
  37. return cma_obj;
  38. error:
  39. - drm_gem_cma_free_object(&cma_obj->base);
  40. + drm->driver->gem_free_object(&cma_obj->base);
  41. return ERR_PTR(ret);
  42. }
  43. EXPORT_SYMBOL_GPL(drm_gem_cma_create);
  44. @@ -171,7 +171,7 @@ drm_gem_cma_create_with_handle(struct dr
  45. return cma_obj;
  46. err_handle_create:
  47. - drm_gem_cma_free_object(gem_obj);
  48. + drm->driver->gem_free_object(gem_obj);
  49. return ERR_PTR(ret);
  50. }