October 21, 2016 - Shuah Khan

Odroid XU4 – Light Display Manager Doesn’t Start on Linux Kernel 4.9-rc1

The Light Display Manager doesn’t start on Odroid XU4 on the recent mainline kernels with exynos_defconfig. I first noticed this problem during the Linux 4.8 rc testing and this problem persists in 4.9-rc1. I want to share the root-cause, and a work-around in this post.

I’m running kernel 4.9.0-rc1 with exynos_defconfig on Ubuntu 16.04 with HDMI. Light Display Manager (lightdm) fails with the following errors.

This block repeats a few times until systemd gives up on starting lightdm. The system is operational with functioning serial console and networking, however the display doesn’t work.

What Causes this problem?

The following sequence of events is what leads to this problem

  1. The user space calls exynos_drm_gem_create_ioctl() with the EXYNOS_BO_NONCONTIG request to allocate GEM buffers.
  2. exynos_drm_gem_create() creates non-contiguous GEM buffers as requested.
  3. exynos_user_fb_create() comes along later and validates the GEM buffers to associate them to frame-buffer. The validation in check_fb_gem_memory_type() detects non-contiguous buffers without IOMMU. Non-contiguous frame buffers can only be supported when IOMMU is enabled, exynos_drm_framebuffer_init() fails.
  4. At this point, there is no recovery and lightdm fails

After digging into the user space angle on the problem, it turns out that xf86-video-armsoc/src/drmmode_exynos/drmmode_exynos.c assumes contiguous allocations are not supported in some Exynos DRM versions. This change was introduced in the following commit

There might have been logic in exynos_drm that forced Contiguous GEM buffers. At least, that is what this comment suggests. This assumption doesn’t appear to be a good one and I’m not sure if this change was made to fix a bug. After IOMMU support was added, this assumption is no longer true. Hence, the recent mainline kernels have a mismatch with the installed xserver-xorg-video-armsoc 1.4.0-0ubuntu2 armhf X.Org X server on my Odroid XU4.

Enabling CONFIG_EXYNOS_IOMMU solves the problem in my case. However, enabling CONFIG_EXYNOS_IOMMU in exynos_defconfig might break non-IOMMU Exynos platforms.

What’s the solution

There are a couple of possible solutions for this problem that worked for me.

  1. Fix xf86-video-armsoc to ask for EXYNOS_BO_CONTIG for ARMSOC_BO_SCANOUT and EXYNOS_BO_NONCONTIG in all other cases. With this change, display manager now starts.  However, it turns out xf86-video-armsoc is obsoleted in favor of xf86-video-modesetting. The last update to xf86-video-armsoc git was 3 years ago and appears to be inactive.

  2.  I settled on using xf86-video-modesetting instead of xf86-video-armsoc as a solution. I removed xf86-video-armsoc from my system, brought in the latest xf86-video-modesetting, compiled, and installed it on my system. xf86-video-modesetting uses dumb_create interface instead of DRM_IOCTL_EXYNOS_GEM_CREATE, hence doesn’t suffer from the CONTIG vs NONCONTIG problem.

Exposing CONTIG and NONCONTIG to userspace appears to be causing problems when exynos drm driver determines it can’t support non-contig GEM buffers during frame-buffer initialization, after the userspace allocates them. I am working on finding solution for this problem.

Shuah Khan

About Shuah Khan

Shuah Khan is a Senior Linux Kernel Developer at Samsung's Open Source Group. She is a Linux Kernel Maintainer and Contributor who focuses on Linux Media Core and Power Management. She maintains Kernel Selftest framework. She has contributed to IOMMU, and DMA areas. In addition, she is helping with stable release kernel testing. She authored Linux Kernel Testing and Debugging paper published on the Linux Journal and writes Linux Journal kernel news articles. She has presented at several Linux conferences and Linux Kernel Developer Keynote Panels. She served on the Linux Foundation Technical Advisory Board. Prior to joining Samsung, she worked as a kernel and software developer at HP and Lucent.

Image Credits: Open Source Way

Development / Linux Bugs / Exynos / IOMMU / ODROID-XU4 /


Leave a Reply to Samsung OSG Contributions to Linux Kernel 4.9 - Samsung Open Source Group Blog Cancel reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Anti-Spam