Intel HD Graphics: scan line wraps around?

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
User avatar
Demindiro
Member
Member
Posts: 96
Joined: Fri Jun 11, 2021 6:02 am
Libera.chat IRC: demindiro
Location: Belgium
Contact:

Intel HD Graphics: scan line wraps around?

Post by Demindiro »

Hello, I'm trying to set the source size (resolution) of pipe A but for some reason the line seems to wrap around:
intel_hd_graphics_1024_wraparound2.jpg
My understanding is that I should be able to freely adjust the size of the pipe. This seems to hold for the vertical size and horizontal sizes smaller than the original size, but for some reason not when the horizontal size is larger than the original size.

I tried disabling and re-enabling the plane but it does not seem to do anything. Likewise, I tried disabling and re-enabling the panel fitter but that seems to cause the first line to be stretched entirely across the vertical axis. I've also tried to adjust the stride but it seems not to have any effect.

To try debug the issue I've dumped the values of some registers to the display when possible (which may or may not be related to the issue at all, I'm running out of ideas):

Code: Select all

0x70180, // PRI_CTL_A
0x70188, // PRI_STRIDE_A
0x68080, // PF_CTRL_A
0x68074, // PF_WIN_SZ_A
0x6001C, // PIPE_SRCSZ_A
0x43408, // IPS_CTL
0x45270, // WM_LINETIME_A
These registers have the following values if I don't adjust anything:

Code: Select all

PRI_CTL_A       0x9800_0000
PRI_STRIDE_A    0x0000_1000
PF_CTRL_A       0x8080_0000
PF_WIN_SZ_A     0x0780_0438
PIPE_SRCSZ_A    0x03ff_02ff
IPS_CTL         0x0000_0000
WM_LINETIME_A   0x0000_0000
PF_WIN_SZ_A indicates the output is 1920x1080, PIPE_SRCSZ_A indicates the input is 1024x768. The stride is 4096 bytes.

When changing the resolution PIPE_SRCSZ_A is 0x077f_0437, which corresponds to 1920x1080.

Changing the stride updates the register but seems to have no effect even when the plane is disabled first.

I have a hunch that I need to disable & properly reconfigure the transcoder (and port?) first to make it work but I'd like to get some pointers first, since it's hard to tell if anything is working without any external serial or Ethernet ports to communicate.

My current code is here. It is very messy though.

I've also attached two diagrams from Volume 11 of the manual since it's part of what gives me the impression the pipe's source size can freely be adjusted.
Attachments
2022-06-16-210225_591x330_scrot.png
2022-06-16-210119_609x810_scrot.png
My OS is Norost B (website, Github, sourcehut)
My filesystem is NRFS (Github, sourcehut)
User avatar
Demindiro
Member
Member
Posts: 96
Joined: Fri Jun 11, 2021 6:02 am
Libera.chat IRC: demindiro
Location: Belgium
Contact:

Re: Intel HD Graphics: scan line wraps around?

Post by Demindiro »

I've successfully managed to set the resolution and the stride properly! :D

I very, very carefully read & implemented the enable & disable sequence for DisplayPort. It still doesn't work but at least I'd have some certainty I don't have to shuffle instructions around to figure out what works. After some heavy commenting & uncommenting of code I found that the following sequence works:

- Disable transcoder
- Disable panel fitter
- Disable transcoder clock (which frankly doesn't seem to do anything because eDP, so it can probably be skipped)
- Disable VGA (which isn't enabled in the first place, but w/e)
- Enable transcoder clock (ditto)
- Configure pipe
- Configure plane
- Enable transcoder without configuring anything else

The next step is to get the full sequence to work, but that's a topic for another day :)

As usual, here's the code for anyone who's interested
My OS is Norost B (website, Github, sourcehut)
My filesystem is NRFS (Github, sourcehut)
Post Reply