[PATCH v2 10/41] drm/modes: Add a function to generate analog display modes
Maxime Ripard
maxime at cerno.tech
Wed Sep 7 14:34:21 UTC 2022
On Mon, Sep 05, 2022 at 06:44:42PM +0200, Mateusz Kwiatkowski wrote:
> Hi Maxime,
>
> W dniu 5.09.2022 o 15:37, Maxime Ripard pisze:
> >>> + vfp = vfp_min + (porches_rem / 2);
> >>> + vbp = porches - vfp;
> >>
> >> Relative position of the vertical sync within the VBI effectively moves the
> >> image up and down. Adding that (porches_rem / 2) moves the image up off center
> >> by that many pixels. I'd keep the VFP always at minimum to keep the image
> >> centered.
> >
> > And you would increase the back porch only then?
>
> Well, increasing vbp only gives a centered image with the default 480i/576i
> resolutions. However, only ever changing vbp will cause the image to be always
> at the bottom of the screen when the active line count is decreased (e.g.
> setting the resolution to 720x480 but for 50Hz "PAL" - like many game consoles
> did back in the day).
>
> I believe that the perfect solution would:
>
> - Use the canonical / standard-defined blanking line counts for the standard
> vertical resolutions (480/486/576)
> - Increase vfp and vbp from there by the same number if a smaller number of
> active lines is specified, so that the resulting image is centered
> - Likewise, decrease vfp and vbp by the same number if the active line number
> is larger and there is still leeway (this should allow for seamless handling
> of 480i vs. 486i for 60 Hz "NTSC")
I'm not sure I understand how that's any different than the code you
initially commented on.
I would start by taking the entire blanking area, remove the sync
period. We only have the two porches now, and I'm starting from the
minimum, adding as many pixels in both (unless it's not an even number,
in which case the backporch will have the extra pixel).
Isn't it the same thing?
> - If even more active lines are specified, once the limit for vfp is hit, then
> decrease vbp only - the resulting image will definitely be off-center, but
> there's no other way
Unless you only want me to consider the front porch maximum?
Maxime
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20220907/57a68a44/attachment-0001.sig>
More information about the dri-devel
mailing list