[Openpvrsgx-devgroup] PVR_K:(Error): DoMapToUser: Error - vmf_insert_mixed failed

H. Nikolaus Schaller hns at goldelico.com
Thu Dec 5 10:50:02 CET 2019


Hi,
a typical error sometimes seen is:

> root at letux:~# gles1test1 
> [  344.204145] PVR_K:(Error): DoMapToUser: Error - vmf_insert_mixed failed (100)
> PVR:(Error): PVRPMapKMem: mmap(2) failed: Mapping handle=0xf: TǶP偾 [0, ]
> PVR:(Error): WSEGL_CreateWindowDrawable: Couldn't set CRTC: Invalid argument [0, ]
> 'eglCreateWindowSurface' returned egl error 'EGL_BAD_ALLOC' (0x3003)
> root at letux:~#

I remember I never did get it with 4.19 kernels.

Therefore I did take another look into the DoMapToUser function and
indeed there is a #if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0))

There I had added code to replace vm_insert_mixed() by vmf_insert_mixed().

By comparing with some other patches that did this replacement I noticed
that not all return values != 0 of vmf_insert_mixed() are real errors.

Especially the one we get (0x100 = VM_FAULT_NOPAGE) isn't included
in VM_FAULT_ERROR.

The correct error handling therefore seems to be

	if (result & VM_FAULT_ERROR)

This solves the DoMapToUser and PVRPMapKMem errors from the kernel module
(tested on BeagleBoneBlack):

> root at letux:~# gles1test1 
> PVR:(Error): WSEGL_CreateWindowDrawable: Couldn't set CRTC: Invalid argument [0, ]
> 'eglCreateWindowSurface' returned egl error 'EGL_BAD_ALLOC' (0x3003)
> root at letux:~#

The other error message is something else.

In this setup I have experimented with replacing my ti,tilcdc,panel driver
by a simple-panel and that may also have some influence on crtc registration.

The 
BR,
Nikolaus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-gpu-pvr-mmap-fix-error-check-for-vmf_insert_mixed.patch
Type: application/octet-stream
Size: 1176 bytes
Desc: not available
URL: <http://lists.goldelico.com/pipermail/openpvrsgx-devgroup/attachments/20191205/c7ece9a3/attachment.obj>


More information about the openpvrsgx-devgroup mailing list