Commit graph

16 commits

Author SHA1 Message Date
Roman Gilg
bb248490cb Log current planes on apply
It is helpful for debugging to know in which state the available planes on an
output are when a layout is applied that leads to a change.

For that log all planes that are compatible with the output. Currently disabled
planes have multiple properties logged per line to keep the log short.
2020-03-18 02:34:47 +01:00
Roman Gilg
780c5b457c Disable plane reset logging
Logigng the list of planes being disabled at the beginning of an apply does not
really give useful information.

Planes are disabled (and by that become in theory ready for layer-assignment)
if they do not have a layer associated at the moment or if they are compatible
with the output.

That is uninteresting since in this list the subset of planes that are
compatible with the output stay constant. And while the subset of planes being
reset not compatible with the output might vary from apply to apply it is also
of less interest since by definition they are not compatible with what the
apply is about.
2020-03-18 02:29:17 +01:00
Roman Gilg
3cb6cd04b5 Log type of assigned planes
On apply log the type of planes in the final assignment for a direct overview
of the result.
2020-03-18 02:29:10 +01:00
Roman Gilg
6b2cbeb0d4
Indent log on property applying and layer assignment
Indent when applying properties and assigning the layers. The log is better to
read this way. Example:

    Apply on output 0x55c447db2b50.
    Layers on CRTC 62:
      Layer 0x55c447db2a40:
        FB_ID = 108
        zpos = 0
        alpha = 65535
        SRC_X = 0
        SRC_Y = 0
        SRC_W = 3840
        SRC_H = 2160
        CRTC_X = 0
        CRTC_Y = 0
        CRTC_W = 3840
        CRTC_H = 2160
    Disabling planes: 55 52 49 46 43 40 71 69 67 65 63 61 58
    Performing allocation for plane 55 (1/13)
      Layer 0x55c447db2a40 -> plane 55: applying properties...
      Layer 0x55c447db2a40 -> plane 55: incompatible properties
    Performing allocation for plane 61 (12/13)
      Layer 0x55c447db2a40 -> plane 61: applying properties...
      Layer 0x55c447db2a40 -> plane 61: incompatible properties
    Performing allocation for plane 58 (13/13)
      Layer 0x55c447db2a40 -> plane 58: applying properties...
      Layer 0x55c447db2a40 -> plane 58: success
    Found a better allocation with score=1
    Found plane allocation for output 0x55c447db2b50 with score=1
    Assigning layers to planes:
      Layer 0x55c447db2a40 -> plane 58
2020-03-08 14:18:09 +01:00
Roman Gilg
b713b17d31
Log re-use only on change
On debug verbosity logging every reuse of planes is spamming the log making it
difficult to debug the process.

With this patch only the change of reusing the same allocation is logged and
how often the allocation was reused after this changed back again.
2020-03-08 13:00:08 +01:00
Simon Ser
95d16704b9
Move device_test_commit to device.c 2020-01-13 12:22:47 +01:00
Simon Ser
64cfbc8e58
Fix format string for plane ID 2020-01-13 10:42:46 +01:00
Simon Ser
53a7bfebc9
Don't allocate planes for layers without a FB
When FB_ID is unet or zero, don't try to allocate a plane for the layer. There's
nothing to display anyway.
2019-12-19 17:50:20 +01:00
Simon Ser
657a9917c5
Add a way to force FB composition
Closes: https://github.com/emersion/libliftoff/issues/17
2019-12-13 11:38:14 +01:00
Simon Ser
c9cdf8ec50
Log layer configuration before alloc 2019-12-12 23:40:01 +01:00
Simon Ser
ceb4a1ff9e
Replace liftoff_device_apply with liftoff_output_apply
Compositors need to drive multiple connectors, each with its own vblank timings.
For each device, there's one separate rendering loop per output.

It's not possible to call liftoff_device_apply each time we want to submit a new
frame to one output, because this could touch another's output state, submitting
a new frame there in the process. When the other output will submit a new frame,
it'll get EBUSY (can't submit two frames without waiting for vblank).

Closes: https://github.com/emersion/libliftoff/issues/21
2019-11-24 18:13:40 +01:00
Simon Ser
ef75ba26e0
Don't re-use previous allocation if a layer has been removed
Start from scratch since we may be able to come up with a better allocation
(if the layer made another layer fall back to composition for instance).

Closes: https://github.com/emersion/libliftoff/issues/30
2019-11-24 13:25:59 +01:00
Simon Ser
b0e2b083f9
Rename display to device
"Display" can also mean "screen"/"monitor", so it's kind of confusing for
this usage.
2019-11-24 12:59:10 +01:00
Simon Ser
5f39331f78
Keep track of the update frequency of each layer
Keep track of the number of layer updates per 60 page-flips.

We could implement a more fine-grained tracking, for instance with a sliding
window. However it's a lot more complex than the current solution and the gains
are not clear. I'd prefer to keep the current solution and experiment with other
solutions once we have a good test-bed.

References: https://github.com/emersion/libliftoff/issues/22
2019-11-15 21:43:44 +01:00
Simon Ser
5faa1e466b
Remove outdated TODO 2019-10-30 20:45:15 +01:00
Simon Ser
ef29d341cb
Move plane allocation algorithm to alloc.c
And move plane-related functions to plane.c.
2019-10-19 13:43:09 +03:00