0337-drm-vc4-Kick-out-the-simplefb-framebuffer-before-we-.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. From b7f009c01e2e55df7286a7de67f41846dc2536a6 Mon Sep 17 00:00:00 2001
  2. From: Eric Anholt <eric@anholt.net>
  3. Date: Tue, 19 Apr 2016 13:24:14 -0700
  4. Subject: [PATCH 337/381] drm/vc4: Kick out the simplefb framebuffer before we
  5. set up KMS.
  6. If we don't, then simplefb stays loaded on /dev/fb0 even though
  7. scanout isn't happening from simplefb's memory area any more, and you
  8. end up with no console.
  9. Signed-off-by: Eric Anholt <eric@anholt.net>
  10. Acked-by: Dave Airlie <airlied@redhat.com>
  11. (cherry picked from commit b3a15f6d55fb584dd4d8baac5d1b6a398720620c)
  12. ---
  13. drivers/gpu/drm/vc4/vc4_drv.c | 20 ++++++++++++++++++++
  14. 1 file changed, 20 insertions(+)
  15. --- a/drivers/gpu/drm/vc4/vc4_drv.c
  16. +++ b/drivers/gpu/drm/vc4/vc4_drv.c
  17. @@ -164,6 +164,24 @@ static void vc4_match_add_drivers(struct
  18. }
  19. }
  20. +static void vc4_kick_out_firmware_fb(void)
  21. +{
  22. + struct apertures_struct *ap;
  23. +
  24. + ap = alloc_apertures(1);
  25. + if (!ap)
  26. + return;
  27. +
  28. + /* Since VC4 is a UMA device, the simplefb node may have been
  29. + * located anywhere in memory.
  30. + */
  31. + ap->ranges[0].base = 0;
  32. + ap->ranges[0].size = ~0;
  33. +
  34. + remove_conflicting_framebuffers(ap, "vc4drmfb", false);
  35. + kfree(ap);
  36. +}
  37. +
  38. static int vc4_drm_bind(struct device *dev)
  39. {
  40. struct platform_device *pdev = to_platform_device(dev);
  41. @@ -208,6 +226,8 @@ static int vc4_drm_bind(struct device *d
  42. if (ret)
  43. goto gem_destroy;
  44. + vc4_kick_out_firmware_fb();
  45. +
  46. ret = drm_dev_register(drm, 0);
  47. if (ret < 0)
  48. goto unbind_all;