Hikey970 What Kernel Source to use for Ubuntu / Debain

I have downloaded and compiled the kernel source from:

According to:

What i am finding is that there are a lot of changes needed for Debain Support !!
Is that correct?

The main issue I have is with the DRM Driver.
Loading LeUbuntu-16.04 from LeMaker website onto the Hikey 970 and the display works properly.
If i compile the 96 Boards Kernel and copy the Image and DTB to the Hikey 970 with Leubuntu the Display no longer works.

Looking at the kernel released with LeUbuntu-16.04 from LeMaker it has version:
Linux version 4.9.78-147538-g244928755bbe (andy@andy-virtual-machine) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Thu May 31 10:58:02 CST 2018

The kernel source i believe that was used is located:

The current state of that source will not build.
The Kernel was also merged to HiHope.
The build issue is defined here.
https://github.com/hihope-hikey/linux/issues/2

If you turn off #define CMA_BUFFER_USED
in kirin_drm_drv.h

The kernel will compile with the same results.
No Display.

So in total there are 3 kernel trees.

https://github.com/hihope-hikey/linux/tree/hikey970-debain

Looking over my Dmesg & Uart logs I can conclude that
#define CMA_BUFFER_USED is required for the display to work.

My questions are.

  1. What kernel source tree should be used for debain support?

  2. Can someone help fix the CMA_BUFFER in the kernel srces.

I am almost positive that the CMA is the cause of the display not working.
I’ve been playing with the kernel and implemented several patches as noted here.

After all the patches are applied looking at my dmesg logs it looks pretty close to working. My backlight on the monitor comes on but the display remains black.

Here are the differences i think are causing the issue.

CAUSES NOT TO BUILD

/* reset all the states of crtc/plane/encoder/connector */
drm_mode_config_reset(dev);

if (fbdev)
	priv->fbdev = kirin_drm_fbdev_init(dev);
else
	priv->fbdev = drm_fbdev_cma_init(dev, 32, 1, 1);

drivers/gpu/drm/hisilicon/kirin9xx/kirin_drm_drv.c: In function ‘kirin_drm_kms_init’:
drivers/gpu/drm/hisilicon/kirin9xx/kirin_drm_drv.c:152:16: error: assignment to ‘struct drm_fb_helper *’ from incompatible pointer type ‘struct drm_fbdev_cma *’ [-Werror=incompatible-pointer-types]
priv->fbdev = drm_fbdev_cma_init(dev,32,1,1);
^
cc1: some warnings being treated as errors

drivers/gpu/drm/hisilicon/kirin9xx/kirin_drm_drv.c: In function ‘kirin_drm_kms_init’:
drivers/gpu/drm/hisilicon/kirin9xx/kirin_drm_drv.c:152:16: error: assignment to ‘struct drm_fb_helper *’ from incompatible pointer type ‘struct drm_fbdev_cma *’ [-Werror=incompatible-pointer-types]
priv->fbdev = drm_fbdev_cma_init(dev, 32, 1, 1);
^

===========================================================================================
BUILDS

if (fbdev)
	priv->fbdev = kirin_drm_fbdev_init(dev);
//else {
//		priv->fbdev = drm_fbdev_cma_init(dev,32,1,1);
//}

Version:
Linux version 4.9.78-147538-g244928755bbe (andy@andy-virtual-machine) (gcc version 4.9.x 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Thu May 31 10:58:02 CST 2018

BLOCK #1 DIFF <<-- W MEANS FROM WORKING <<–NW MEANS NOT WORKING <<-- B MEANS BOTH
#############################################################################################################################
[ 0.805722] [drm] Initialized <<-- B
[ 0.806092] [drm] the device node is dpe <<-- B
[ 0.806124] [drm] the device remote node is dsi <<-- B

0.770679] kirin-drm e8600000.dpe: assigned reserved memory node drm_dma_mem_region <<-- w

[ 0.806374] [drm] dss_pwm_clk:[80000000]->[83000000]. <<-- B
[ 0.806440] [drm] adv match_node ok <<-- B
#############################################################################################################################

BLOCK #2 DIFF <<-- W MEANS FROM WORKING <<-- NW MEANS NOT WORKING <<-- B MEANS BOTH
#############################################################################################################################
[ 0.819282] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). <<-- B
[ 0.819283] [drm] No driver support for vblank timestamp query. <<-- B

[ 0.819289] [drm] num_crtc=1, num_connector=2. <<-- NW dev->mode_config.num_crtc, dev->mode_config.num_connector);
[ 0.819297] [drm:drm_helper_disable_unused_functions] ERROR Called for atomic driver, this is not what you want. <<-- NW

[ 0.829798] [drm] connected : regmap_read val = 0xf0 <<-- B
[ 0.829799] [drm] hdmi connector status = 1 <<-- B
[ 1.043668] random: fast init done <<-- B
#######################################################################################################################

BLOCK #3 DIFF <<-- W MEANS FROM WORKING <<-- NW MEANS NOT WORKING <<-- B MEANS BOTH
#############################################################################################################################

[ 1.046497] BAD <<-- B
[ 1.046511] [drm] kms: can’t enable cloning when we probably wanted to. <<-- B

[ 1.050136] [drm] fbdev->smem_start = 0x262144, fbdev->screen_base = 0xffff00000d001000 <<-- NW

[ 1.050280] kirin-drm e8600000.dpe: fb0: dss frame buffer device <<-- B

BLOCK #4 DIFF <<-- W MEANS FROM WORKING <<-- NW MEANS NOT WORKING <<-- B MEANS BOTH
#############################################################################################################################

[ 2.022560] [drm] client change to HDMI <<-- B

[ 2.022561] [drm] hotplug_event!!! <<-- W

[ 2.023151] [drm] connected : regmap_read val = 0xf0 <<-- B
[ 2.023152] [drm] hdmi connector status = 1 <<-- B

BLOCK #5 DIFF <<-- W MEANS FROM WORKING <<-- NW MEANS NOT WORKING <<-- B MEANS BOTH
#############################################################################################################################
[ 3.162581] [drm] bl_level is 255 <<-- B
[ 3.162590] [drm] bl_level=255. <<-- B

[ 3.175286] [drm] hotplug_event!!! <<-- W

[ 3.175838] vgaarb: this pci device is not a vga device <<-- B


The working kernel outputs
0.770679] kirin-drm e8600000.dpe: assigned reserved memory node drm_dma_mem_region
[drm] hotplug_event!!!


The non working kernel outputs.
[ 1.050136] [drm] fbdev->smem_start = 0x262144, fbdev->screen_base = 0xffff00000d001000 <<-- NW

[ 0.819289] [drm] num_crtc=1, num_connector=2. <<-- NW dev->mode_config.num_crtc, dev->mode_config.num_connector);
[ 0.819297] [drm:drm_helper_disable_unused_functions] ERROR Called for atomic driver, this is not what you want. <<-- NW


Seems that the working kernel uses drm_dma_mem_region

Seems the non working uses.
[drm] fbdev->smem_start = 0x262144, fbdev->screen_base = 0xffff00000d001000 <<-- NW

What needs done to get
kirin-drm e8600000.dpe: assigned reserved memory node drm_dma_mem_region

From the 96 boards hikey kernel?

There are 3 files involved in this.

/Kernel-SRC/linux/drivers/gpu/drm/hisilicon/kirin9xx/kirin_drm_drv.c
/Kernel-SRC/linux/drivers/gpu/drm/hisilicon/kirin9xx/kirin_drm_drv.h
/Kernel-SRC/linux/drivers/gpu/drm/hisilicon/kirin9xx/kirin_fbdev.c

A lot of people are angry because there is no linux driver for the Mali GPU.
I think some of this is coming about because the DRM Driver isn’t working in the kernel.
Someone Please help me fix the DRM Driver.

2 Likes