[PATCH] drm: Don't override active mode.

Ray Strode halfline at gmail.com
Sun Jun 13 20:35:48 PDT 2010


Hi,

On Sun, Jun 13, 2010 at 1:27 PM, Forest Bond <forest at alittletooquiet.net> wrote:
> The drm renderer calls drmModeSetCrtc to tell the CRTC to use the
> allocated scan out buffer.  This should not result in setting a
> new mode for the CRTC, but can do exactly that since plymouth saves
> the wrong mode when creating heads, and inadvertently overrides the
> initial mode set by the kernel.
>
> The root of the problem is the assumption that the first mode in the
> connector's mode list is the current active mode.  This will be true
> if the active mode is set by automatic detection, as the kernel will
> have selected the first mode in the list as the initial mode, but it
> will not be true if the user has selected a different mode via the
> video= kernel boot parameter.
>
> To fix this, the saved mode is copied from the controller itself,
> unless that mode is for some reason not valid, in which case we fall
> back to the old behavior (which could result in a mode switch).
Ah, very clear description of the problem.  Thanks for taking the time
to write such a detailed commit message.

Your patch seems basically fine, but I don't really like the idea of
calling drmModeFreeModeInfo on memory we allocate ourselves with
calloc.

I've done three commits here:

http://cgit.freedesktop.org/plymouth/commit/?id=abfda7550ac2fca6d816862e271126c2f44fa3cc
http://cgit.freedesktop.org/plymouth/commit/?id=b5b5f081bae003fd2d8065586249085f11d1c4a7
http://cgit.freedesktop.org/plymouth/commit/?id=9f25189bc8c6cb77cc37e3325e1089e23addf9a0

that restructure things, so we don't keep a duplicated copy of the
mode around in the head strucutre and attempts to fix yoru problems
I haven't given them any testing yet.  Do they look okay to you?

--Ray


More information about the plymouth mailing list