Commit graph

13 commits

Author SHA1 Message Date
Roman Gilg
273cf8a432
feat: 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.

Example:

== Apply request for output 62 ==
  Note: Reused previous plane allocation 5 times.

Available planes (on output 62):
  Plane 55:
    type: primary
    FB_ID: 93
    IN_FENCE_FD: -1
    CRTC_ID: 62
    CRTC_X: 39
    CRTC_Y: 0
    CRTC_W: 3761
    CRTC_H: 2160
    SRC_X: 0
    SRC_Y: 0
    SRC_W: 2349
    SRC_H: 1349
    COLOR_ENCODING: 0
    COLOR_RANGE: 0
  Plane 61 (inactive):
    type: cursor FB_ID: 0 IN_FENCE_FD: -1 CRTC_ID: 0
    CRTC_X: 0 CRTC_Y: 0 CRTC_W: 0 CRTC_H: 0
    SRC_X: 0 SRC_Y: 0 SRC_W: 0 SRC_H: 0
  Plane 58 (inactive):
    type: overlay FB_ID: 0 IN_FENCE_FD: -1 CRTC_ID: 0
    CRTC_X: 0 CRTC_Y: 0 CRTC_W: 0 CRTC_H: 0
    SRC_X: 0 SRC_Y: 0 SRC_W: 0 SRC_H: 0
    alpha: 65535 pixel blend mode: 0

Committed layers:
  Layer 0x561febd41260:
    FB_ID = 93
    zpos = 0
    SRC_X = 0
    SRC_Y = 0
    SRC_W = 2349
    SRC_H = 1349
    CRTC_X = 39
    CRTC_Y = 0
    CRTC_W = 3761
    CRTC_H = 2160
  Layer 0x561febd3c830:
    FB_ID = 110
    zpos = 2
    SRC_X = 0
    SRC_Y = 0
    SRC_W = 48
    SRC_H = 48
    CRTC_X = 66
    CRTC_Y = 39
    CRTC_W = 48
    CRTC_H = 48

Reset planes: 55 52 49 46 43 40 <p|c> 71 69 67 65 63 61 <c|o> 58

Performing allocation for plane 55 (1/13)
  Layer 0x561febd41260 -> plane 55: applying properties...
  Layer 0x561febd41260 -> plane 55: success
Performing allocation for plane 61 (12/13)
  Layer 0x561febd3c830 -> plane 61: applying properties...
  Layer 0x561febd3c830 -> plane 61: success
Performing allocation for plane 58 (13/13)
Found a better allocation with score=2
  Layer 0x561febd3c830 -> plane 55: applying properties...
  Layer 0x561febd3c830 -> plane 55: success
Performing allocation for plane 61 (12/13)
  Layer 0x561febd41260 -> plane 61: applying properties...
  Layer 0x561febd41260 -> plane 61: success
Performing allocation for plane 58 (13/13)
Found plane allocation for output 0x561febd3e2a0 with score=2

Final assignment of layers to planes:
  [1] Layer 0x561febd41260 -> plane 55 (primary)
  [2] Layer 0x561febd3c830 -> plane 61 (cursor)
2020-03-10 11:59:38 +01:00
Roman Gilg
31024f307e
feat: log output relevant data
Log the creation of outputs and simplify output-specific data on apply.
2020-03-10 11:56:58 +01:00
Roman Gilg
52cd24a904
Omit logging inactive layer information
It is only of interest to log the currently active layers when debugging.
A layer is inactive when it does not have an fb and composition is not forced.

Check layers for that and otherwise skip them. Also tell if composition is
actually forced on the layer.
2020-03-08 22:31:59 +01:00
Roman Gilg
71bd11377a
Respect implicit type on layer props log
The CRTC_X and CRTC_Y values can be negative. Log respectively. Additionally
the SRC_W and SRC_H values are shifted. Shift these values back for the log.
2020-03-08 22:30:08 +01:00
Roman Gilg
375a8123d2
Skip layer debug early
If the verbosity is low we can skip logging layer information early and do not
need to run the loop.
2020-03-08 13:06:11 +01:00
Simon Ser
cfeee41ec1
Allow NULL to be passed to destructors
In this case, the destructor will be a no-op. This is similar to free(3)'s
behavior and allows to omit a NULL check for callers.
2019-12-31 20:46:08 +01:00
Simon Ser
c9cdf8ec50
Log layer configuration before alloc 2019-12-12 23:40:01 +01:00
Simon Ser
d8c20ddac2
Don't re-use prev alloc on composition layer change 2019-12-12 23:23:53 +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
e9433997d9
Add liftoff_output_set_composition_layer
This lets the library user define a layer where composition will happen. At the
moment there can be at most one composition layer per output, on the primary
plane. It should be possible to remove these restrictions in the future if
desirable.

The composition layer will be put on a plane if and only if composition is
needed.

The compositor needs to know where composited layers will be blended to resolve
zpos conflicts.

Closes: https://github.com/emersion/libliftoff/issues/9
2019-10-11 14:31:17 +03:00
Simon Ser
caac9bc87f
Rename library to liftoff
Let's make these planes useful!
2019-09-12 11:40:21 +03:00
Simon Ser
d90d7bdc36
Check plane is compatible with CRTC
This allows us to rule out some potential solutions.

Closes: https://github.com/emersion/libhwc/issues/2
2019-09-08 17:41:25 +03:00
Simon Ser
9fe471dd6b
Initial experiments 2019-08-21 23:07:37 +03:00