Unable to enable hardware overlay with Intel GPUs

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
superymk
Posts: 3
Joined: Tue Apr 19, 2022 2:03 pm

Unable to enable hardware overlay with Intel GPUs

Post 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!
Gigasoft
Member
Member
Posts: 856
Joined: Sat Nov 21, 2009 5:11 pm

Re: Unable to enable hardware overlay with Intel GPUs

Post by Gigasoft »

Not sure if this is the problem, but PLANE_SURF has to be written last, I think.
Octocontrabass
Member
Member
Posts: 5560
Joined: Mon Mar 25, 2013 7:01 pm

Re: Unable to enable hardware overlay with Intel GPUs

Post 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.
superymk
Posts: 3
Joined: Tue Apr 19, 2022 2:03 pm

Re: Unable to enable hardware overlay with Intel GPUs

Post 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?
Post Reply