libliftoff icon indicating copy to clipboard operation
libliftoff copied to clipboard

Check format & modifier

Open emersion opened this issue 5 years ago • 3 comments

Before trying an atomic test commit, check the format & modifier is compatible.

It's not clear it's a good idea yet: all we get is a FB ID. We can drmModeGetFB it, but then we don't save an ioctl. If we cache the info, it may become out-of-date (e.g. FB deleted and re-created with another format).

Maybe we can just get the format/modifier from the library user. Need to check whether that would really improve performance though.

emersion avatar Sep 08 '19 14:09 emersion

but then we don't save an ioctl

Actually, if we only drmModeGetFB once at the beginning of the plane alloc (or lazily), then we could save multiple atomic test commits.

emersion avatar Sep 12 '19 08:09 emersion

Unfortunately drmModeGetFB doesn't provide the format/modifier. We'll need to get it from the compositor (liftoff_layer_set_fb?), which we may have ended up doing anyway to avoid getting from the kernel information owned by the compositor itself.

emersion avatar Oct 11 '19 15:10 emersion

There's a patch for getFB2: https://patchwork.freedesktop.org/patch/334263/?series=67552&rev=1

Still not sure it's a good idea to use it.

emersion avatar Oct 14 '19 17:10 emersion