Page 1 of 1

Unable to enable hardware overlay with Intel GPUs

Posted: Mon Jul 03, 2023 4:04 pm
by superymk
Hi,



I'd like to write an OS driver to enable the hardware overlay to show my own images on top of OS and all other applications. So I programmed the plane 2's registers of PLANE_* as described in the programming manual intel-gfx-prm-osrc-kbl-vol02c-commandreference-registers-part2_0.pdf. However, the GPU immediately outputs nothing or glitch images, and Linux kernel also reports "[ 1099.357307] i915 0000:00:02.0: [drm] *ERROR* CPU pipe A FIFO underrun".



My CPU is i5-7600.

My GPU is "VGA compatible controller: Intel Corporation HD Graphics 630 (rev 04) (prog-if 00 [VGA controller]) Subsystem: Dell HD Graphics 630". The BAR0 is "Region 0: Memory at ee000000 (64-bit, non-prefetchable) [size=16M]".

The GPU connects to only one monitor thru HDMI.



I tried the following MMIO writes in both Ubuntu 22.04 x64 (thru intel-gpu-tools) and Win10 x64 (thru remote debugging):

In Ubuntu:

```

sudo intel_reg write 0x70280 0xc4842000; \
sudo intel_reg write 0x7029c 0x00940000; \
sudo intel_reg write 0x70290 0x0137027f; \
sudo intel_reg write 0x70288 0x28;

```



In Win10:

```

!ed [uc] 0xee070280 0x84000000;!ed [uc] 0xee07029c 0x11000000;!ed [uc] 0xee070290 0x02ff03ff;!ed [uc] 0xee070288 0x40; !ed [uc] 0xee07028c 0x00ff00ff;

```



I expect to see small glitch images on top of OS and other applications. But in reality, the plane 1 seems also to fail to output. I set the surf base for plane 2 based on the value for plane 1. So the frame buffer of plane 2 should be largely mapped in GTT.



I also modified the surf base of plane 1 and can get the expected result. So the MMIO writes are successful.



Appreciate any clues, thanks!

Re: Unable to enable hardware overlay with Intel GPUs

Posted: Mon Jul 03, 2023 5:45 pm
by Gigasoft
Not sure if this is the problem, but PLANE_SURF has to be written last, I think.

Re: Unable to enable hardware overlay with Intel GPUs

Posted: Mon Jul 03, 2023 6:27 pm
by Octocontrabass
superymk wrote:Linux kernel also reports "[ 1099.357307] i915 0000:00:02.0: [drm] *ERROR* CPU pipe A FIFO underrun".
I don't think having two drivers accessing the same device is a good idea.

Re: Unable to enable hardware overlay with Intel GPUs

Posted: Wed Jul 05, 2023 8:50 am
by superymk
Thanks a lot, @Gigasoft and @Octocontrabass! I write PLANE_SURF at last now but still get the corrupted plane 1.
My new commands are:
```
sudo intel_reg write 0x70290 0x0137027f; \
sudo intel_reg write 0x7028c 0x03ff02ff; \
sudo intel_reg write 0x70288 0x28; \
sudo intel_reg write 0x70280 0xc4842000; \
sudo intel_reg write 0x7029c 0x02180000;
```

The display is:
https://pasteboard.co/6H7sWuw4RHs1.jpg

The plane 2 does not work correctly in the image because PLANE_POS_2_A has a large offset (around the middle of the screen) in the above commands and my monitor's resolution is 1920*1080.

PS: Are there any programs/libs utilizing the plane 2 as an overlay?