Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/arm/hdlcd: Take over EFI framebuffer properly

The Arm Juno board EDK2 port has provided an EFI GOP display via HDLCD0
for some time now, which works nicely as an early framebuffer. However,
once the HDLCD driver probes and takes over the hardware, it should
take over the logical framebuffer as well, otherwise the now-defunct GOP
device hangs about and virtual console output inevitably disappears into
the wrong place most of the time.

We'll do this after binding the HDMI encoder, since that's the most
likely thing to fail, and the EFI console is still better than nothing
when that happens. However, the two HDLCD controllers on Juno are
independent, and many users will still be using older firmware without
any display support, so we'll only bother if we find that the HDLCD
we're probing is already enabled. And if it is, then we'll also stop it,
since otherwise the display can end up shifted if it's still scanning
out while the rest of the registers are subsequently reconfigured.

Signed-off-by: Robin Murphy <robin.murphy@arm.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/31acd57f4aa8a4d02877026fa3a8c8d035e15a0d.1655309004.git.robin.murphy@arm.com

authored by

Robin Murphy and committed by
Liviu Dudau
4b760f76 b62cc8fa

+10
+10
drivers/gpu/drm/arm/hdlcd_drv.c
··· 21 21 #include <linux/platform_device.h> 22 22 #include <linux/pm_runtime.h> 23 23 24 + #include <drm/drm_aperture.h> 24 25 #include <drm/drm_atomic_helper.h> 25 26 #include <drm/drm_crtc.h> 26 27 #include <drm/drm_debugfs.h> ··· 313 312 if (ret < 0) { 314 313 DRM_ERROR("failed to initialise vblank\n"); 315 314 goto err_vblank; 315 + } 316 + 317 + /* 318 + * If EFI left us running, take over from simple framebuffer 319 + * drivers. Read HDLCD_REG_COMMAND to see if we are enabled. 320 + */ 321 + if (hdlcd_read(hdlcd, HDLCD_REG_COMMAND)) { 322 + hdlcd_write(hdlcd, HDLCD_REG_COMMAND, 0); 323 + drm_aperture_remove_framebuffers(false, &hdlcd_driver); 316 324 } 317 325 318 326 drm_mode_config_reset(drm);