OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 4:25 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Intel HD Graphics: scan line wraps around?
PostPosted: Thu Jun 16, 2022 1:06 pm 
Offline
Member
Member
User avatar

Joined: Fri Jun 11, 2021 6:02 am
Posts: 96
Location: Belgium
Hello, I'm trying to set the source size (resolution) of pipe A but for some reason the line seems to wrap around:

Attachment:
intel_hd_graphics_1024_wraparound2.jpg
intel_hd_graphics_1024_wraparound2.jpg [ 81.75 KiB | Viewed 765 times ]


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:
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:
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-210225_591x330_scrot.png [ 24.97 KiB | Viewed 765 times ]
2022-06-16-210119_609x810_scrot.png
2022-06-16-210119_609x810_scrot.png [ 107.5 KiB | Viewed 765 times ]

_________________
My OS is Norost B (website, Github, sourcehut)
My filesystem is NRFS (Github, sourcehut)
Top
 Profile  
 
 Post subject: Re: Intel HD Graphics: scan line wraps around?
PostPosted: Fri Jun 17, 2022 7:54 am 
Offline
Member
Member
User avatar

Joined: Fri Jun 11, 2021 6:02 am
Posts: 96
Location: Belgium
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)


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

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 77 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