PabloPL / linux

Linux kernel source tree
Other
17 stars 0 forks source link

PVR usabilty/stability on 5.9 #43

Closed kwizart closed 3 years ago

kwizart commented 3 years ago

I'm using a dedicated issue to track the PVR problem I have on my userspace (Fedora 31) using upstream 5.9. kernel, I'm using xc-racer99/linux/tree/v5.9-rc2-all-devices rebased on top of v5.9.5.

[Service] Type=oneshot ExecStart=/usr/bin/pvrsrvctl --start --no-module

[Install] WantedBy=multi-user.target EOF

* ps aux |grep pvr

root 324 0.0 0.0 0 0 ? I< 16:44 0:00 [pvr_timer] root 433 0.0 0.0 0 0 ? I< 16:44 0:00 [pvr_workqueue] root 615 0.0 0.5 7688 2012 pts/0 S+ 16:48 0:00 grep --color=auto pvr

If the pvr service isn't successful I only have pvr_timer when the pvrsrvkm_s5pv210_sgx540_120 module is loaded...

* drmdevice shows exynos-drm in render128 and card0 and samsung,s5pv210-sgx540-120 in card1 render129

* cat /etc/powervr.ini 

[default] WindowSystem=libpvrDRMWSEGL.so DefaultPixelFormat=RGB888



Here is the output when running the command from the remote terminal as user.
[galaxys-eglinfo_kmscube.txt](https://github.com/PabloPL/linux/files/5495537/galaxys-eglinfo_kmscube.txt)

Here is the journal output 
[galaxys-pvrsgx-5.9.5.txt](https://github.com/PabloPL/linux/files/5495539/galaxys-pvrsgx-5.9.5.txt)
xc-racer99 commented 3 years ago

Odd, it looks like the PVR driver is freezing up. I wonder if there's some clock issue with my forward porting.

Do you have a link to the fedora you're using? I'd like to try it out when I have a chance. May not be soon as I don't have as much free time as I used to.

kwizart commented 3 years ago

I will probably rebase on fedora 33 that can be downloaded from https://arm.fedoraproject.org/ I recommend to pick the Fedora Minimal (under the Server tab), because others spins default to btrfs which is too ambitious for my use case.

For Fedora 31, I've used the LXDE Spin, at: https://download.fedoraproject.org/pub/fedora/linux/releases/31/Spins/Fedora-LXDE-armhfp-31-1.9-sda.raw.xz

IIRC, I've bootstrapped the install on another device to setup the hostname, wifi , disable selinux and remote access, then installed the dracut-config-generic package to create a generic initramfs from foreign host that can be consumed by the galaxys.

xc-racer99 commented 3 years ago

Ok, I've been able to reproduce this. Looks like we need to change a build option, as per https://lists.goldelico.com/pipermail/openpvrsgx-devgroup/2020-November/000449.html

Untested, but fixes the same issue as seen on OMAP4.

xc-racer99 commented 3 years ago

I can now confirm that adding -DPVR_LINUX_MEM_AREA_USE_VMAP to the build options does indeed fix things. Kmscube is now working again.

Patch as per @tmlind

diff --git a/drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/Makefile b/drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/Makefile
index fb5507bf5ba31..fdca642a9c3e2 100644
--- a/drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/Makefile
+++ b/drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/Makefile
@@ -117,6 +117,7 @@ ccflags-y += \
    -DLDM_PLATFORM \
    -DSUPPORT_SGX_EVENT_OBJECT \
    -DPVR2D_ALT_2DHW \
+   -DPVR_LINUX_MEM_AREA_USE_VMAP \
    -DSUPPORT_SGX_HWPERF \
    -DSUPPORT_SGX_LOW_LATENCY_SCHEDULING \
    -DSUPPORT_LINUX_X86_PAT \

Going to close this issue as that should resolve it. Looks like I won't need to setup a Fedora install after all :)

kwizart commented 3 years ago

Confirmed, kmscube works like a charm. Thanks! glmark2-es2-drm

=======================================================
    glmark2 2017.07
=======================================================
    OpenGL Information
    GL_VENDOR:     Imagination Technologies
    GL_RENDERER:   PowerVR SGX 540
    GL_VERSION:    OpenGL ES 2.0 build 1.17@4948957
=======================================================
 [ ...]
                                  glmark2 Score: 38 
=======================================================