circle looks like an ellipse on real display
circle looks like an ellipse on real display
Hi,
I have implemented a basic linear framebuffer graphics driver with support for some basic shapes like rectangles, lines, and circles.
On QEMU emulator - where I am using 800x600x32 resolution - everything looks fine. However, when I boot my OS on a real laptop, with one of the supported resolutions like 800x600x32 or 1024x768x32, the circle looks like an ellipse - stretched horizontally. The same with lines and rectangles - they are stretched horizontally.
Does anyone know why this could be the case - I think I may be committing a known/common mistake that most newbies do while writing linear framebuffer-based graphics driver
PS: I am using grub bootloader and selecting the resolution by setting gfxmode and gfxpayload variables in grub.cfg
Thanks
Prajwal
I have implemented a basic linear framebuffer graphics driver with support for some basic shapes like rectangles, lines, and circles.
On QEMU emulator - where I am using 800x600x32 resolution - everything looks fine. However, when I boot my OS on a real laptop, with one of the supported resolutions like 800x600x32 or 1024x768x32, the circle looks like an ellipse - stretched horizontally. The same with lines and rectangles - they are stretched horizontally.
Does anyone know why this could be the case - I think I may be committing a known/common mistake that most newbies do while writing linear framebuffer-based graphics driver
PS: I am using grub bootloader and selecting the resolution by setting gfxmode and gfxpayload variables in grub.cfg
Thanks
Prajwal
complexity is the core of simplicity
- AndrewAPrice
- Member
- Posts: 2300
- Joined: Mon Jun 05, 2006 11:00 pm
- Location: USA (and Australia)
Re: circle looks like an ellipse on real display
Possibly the emulator is showing 800x600 in a non-widescreen 4:3 ratio window and the real hardware is stretching 800x600 to be wide screen?
My OS is Perception.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: circle looks like an ellipse on real display
That's exactly what's happening.
You can fix it by choosing a resolution that matches the shape of the laptop's screen. If possible, choose the laptop's native resolution.
You can fix it by choosing a resolution that matches the shape of the laptop's screen. If possible, choose the laptop's native resolution.
Re: circle looks like an ellipse on real display
I think that if it is an Intel laptop, you will be out of luck. Several of those only support 4x3 resolutions both using VBE and EFI, even if you have a widescreen display. Not even the BIOS manufacturer will be able to fix this as Intel only want to support operating systems that have their own native Intel display drivers. Additionally, the 4x3 emulation they provide is horribly slow.
Re: circle looks like an ellipse on real display
It's definitely a poor situation on older systems, though it's usually better on EFI - you're far more likely to get native panel resolutions out of GOP. On some BIOS systems, you could patch the VGA BIOS to replace one of the available VBE modes with the native panel resolution and timings.rdos wrote:I think that if it is an Intel laptop, you will be out of luck. Several of those only support 4x3 resolutions both using VBE and EFI, even if you have a widescreen display. Not even the BIOS manufacturer will be able to fix this as Intel only want to support operating systems that have their own native Intel display drivers. Additionally, the 4x3 emulation they provide is horribly slow.
Luckily, Intel GPUs aren't too hard to write barebones modesetting drivers for, especially if you just want to get one specific display working. Toaru has one just for my old ThinkPad, which has a 1440x900 panel but only offered up to 1280x800 from VBE (at least that's the right aspect ratio!)
Re: circle looks like an ellipse on real display
It is an intel laptop and uses UEFI. I am relying on grub to initialize the graphics to provide me the linear framebuffer to play with. I am basically picking a resolution that is listed as one of the supported resolutions when I run the "videoinfo" command in the grub command prompt (i.e. pressing 'c' in grub boot menu, entering grub command prompt and run "videoinfo" command to list down all supported resolutions)
Thanks
Prajwal
Thanks for that link - I will look into this.Luckily, Intel GPUs aren't too hard to write barebones modesetting drivers for, especially if you just want to get one specific display working. Toaru has one just for my old ThinkPad,
Thanks
Prajwal
complexity is the core of simplicity
Re: circle looks like an ellipse on real display
It's my impression that it is worst on newer systems and works better on older. Which seems to coincidence with Linux having native video drivers, and so Intel no longer feel they need to provide the native resolution of the display through VBE or EFI. They will typically support only 640x480, 800x600 and 1024x768.klange wrote:It's definitely a poor situation on older systems, though it's usually better on EFI - you're far more likely to get native panel resolutions out of GOP.rdos wrote:I think that if it is an Intel laptop, you will be out of luck. Several of those only support 4x3 resolutions both using VBE and EFI, even if you have a widescreen display. Not even the BIOS manufacturer will be able to fix this as Intel only want to support operating systems that have their own native Intel display drivers. Additionally, the 4x3 emulation they provide is horribly slow.
That's an interesting approach. Does this only work for a very specific Intel GPU, or for a larger range of models?klange wrote: On some BIOS systems, you could patch the VGA BIOS to replace one of the available VBE modes with the native panel resolution and timings.
Luckily, Intel GPUs aren't too hard to write barebones modesetting drivers for, especially if you just want to get one specific display working. Toaru has one just for my old ThinkPad, which has a 1440x900 panel but only offered up to 1280x800 from VBE (at least that's the right aspect ratio!)
Re: circle looks like an ellipse on real display
My pc with an 1920x1080 display has the same problem (Nvidia QUADRO 2000).
Everything on the screen is stretched without gpu driver (in GOP and VBE mode)
Everything on the screen is stretched without gpu driver (in GOP and VBE mode)
Re: circle looks like an ellipse on real display
I have a relatively new AMD laptop with a widescreen display, and GOP has the native resolution. I've not yet seen any AMD BIOS that doesn't support the native resolution. It seems to be an Intel problem. Additionally, AMDs displays are much faster at the same resolution when using LFB.
Re: circle looks like an ellipse on real display
It is wise to not assume square pixels, and provide for a way to adjust the pixel aspect ratio.