[PATCH weston v4] compositor-drm: Ignore non-KMS devices

Daniel Stone daniel at fooishbar.org
Tue Feb 14 13:47:18 UTC 2017


Hi Emil,

On 14 February 2017 at 09:48, Daniel Stone <daniel at fooishbar.org> wrote:
> On 13 February 2017 at 23:42, Emil Velikov <emil.l.velikov at gmail.com> wrote:
>> Thinking about this a bit more this won't fly either, I'm afraid. In
>> the previous version we'll keep potentially old/unwanted device open,
>> leaking. While this this version we'll never call
>> weston_launcher_open() in the case of boot_vga=1.
>> I would split out the is_kms heuristic from the setup part, as the the
>> latter must be common for both boot_vga and is_kms cases.
>>
>> So you'll need some tracking of the [first] fd & filename similar to
>> how drm_device is handled. Thus, as newer more suitable device (either
>> matches_seat && boot_vga or matches_seat && is_kms) is found the old
>> data is torn down.
>
> OK, good point. Beginning to wish I never sent this, but will send v5
> later on today.

I couldn't think of quite what was bothering me about your mail, but
figured it out on a re-read. 'matches_seat && boot_vga' is _not_
sufficient; if, for whatever reason, our boot_vga device does not
actually expose any modesetting primitives, then we cannot use it for
modesetting, so we must discard it. IOW, matches_seat and is_kms are
_mandatory_ tests, whilst boot_vga is an optional test, used only for
preference. So, any (matches_seat && boot_vga && is_kms) device will
always be returned by this function, however in the absence of such a
device, we may return a (matches_seat && is_kms) device. Any device
which fails either of the latter two tests must be discarded.

v5 inbound.

Cheers,
Daniel


More information about the wayland-devel mailing list