OSDev.org

The Place to Start for Operating System Developers
It is currently Sat Apr 27, 2024 6:50 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Unable to enable hardware overlay with Intel GPUs
PostPosted: Mon Jul 03, 2023 4:04 pm 
Offline

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


Top
 Profile  
 
 Post subject: Re: Unable to enable hardware overlay with Intel GPUs
PostPosted: Mon Jul 03, 2023 5:45 pm 
Offline
Member
Member

Joined: Sat Nov 21, 2009 5:11 pm
Posts: 852
Not sure if this is the problem, but PLANE_SURF has to be written last, I think.


Top
 Profile  
 
 Post subject: Re: Unable to enable hardware overlay with Intel GPUs
PostPosted: Mon Jul 03, 2023 6:27 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5146
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.


Top
 Profile  
 
 Post subject: Re: Unable to enable hardware overlay with Intel GPUs
PostPosted: Wed Jul 05, 2023 8:50 am 
Offline

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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: eekee and 19 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group