Program the connector property HDR_OUTPUT_METADATA based on the EOTF
mode of the output.
For now, this changes only the EOTF. The colorimetry and luminance are
left undefined, to be filled in by later patches. This should still be
enough to put a video sink into HDR mode, albeit the response is
probably unknown.
drm_output keeps track of the currently existing blob id. If the blob
contents need to be re-created, this blob would be destroyed and the
field set to zero. In this patch, there is no provision for runtime
changing of HDR metadata, so there is no code doing that.
Destroying the blob at arbitrary times is not a problem, because the
kernel keeps a reference to the data as long as the blob id remains with
KMS.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Check whether HDR_OUTPUT_METADATA property exists on a KMS connector. If
yes, pretend that EDID claims support for all EOTF modes and update the
head supported EOTFs mask accordingly. If not, then only SDR is
possible.
Parsing EDID to take monitor capabilities into account is left for
later.
HDR mode cannot be set without HDR_OUTPUT_METADATA.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This header is for sharing fallback definitions for drm_fourcc.h. A new
test in tests/yuv-buffer-test.c is going to be needing XYUV8888 format,
and more new formats will be expected with HDR supports.
Share these fallback definitions in one place instead of copying them
all over.
All users of drm_fourcc.h are converted to include weston-drm-fourcc.h
instead for consistency: have the same definitions available everywhere.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Instead of calling drmModeObjectGetProperties() each time that we need
the connector properties, it is better to keep a reference for it in
struct drm_connector. This reference is only updated when is necessary.
E.g. hotplug events.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This is the first step in order to add support for writeback
connector in Weston. We don't want writeback connectors data
to be stored in 'struct drm_head' objects, as these objects are
used to output content and we should not use writeback connectors
for this purpose.
The writeback connectors will be stored in a new 'struct
drm_writeback', but the connector data is common between
'struct drm_head' and 'struct drm_writeback'.
So move connector data from 'struct drm_head' to 'struct
drm_connector'. This helps to avoid code duplication and makes
the code clearer.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The KMS 'panel orientation' property allows the driver to statically
declare a fixed rotation of an output device. Now that weston_head has a
transform member, plumb the KMS property through to weston_head so the
compositor can make a smarter choice out of the box.
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
[daniels: Extracted from one of Lucas's patches]
Signed-off-by: Daniel Stone <daniels@collabora.com>
Just a couple of places which shouldn't be possible, so initialized and
added assertions to make sure.
Signed-off-by: Scott Anderson <scott.anderson@collabora.com>
When the aspect-ratio-aware mode support was added to Weston, it was
done before the libdrm support was finalised and merged. Between it
being added to Weston and being merged, it changed to no longer provide
the offset for the bitmask.
Instead of using the mask and a compatible enum, if we update our
libdrm dependency, we can use the flag definitions directly from libdrm.
In 94e4068ba1, the libdrm dependency was bumped to 2.4.83, which
enabled us to remove a bunch of error-prone ifdefs by making atomic and
modifier support mandatory.
We determined in the discussion of !311 that it was safe to push the
dependency as high as 2.4.91, as that was what was available in major
distributions.
Bumping to 2.4.86 allows us to safely remove the ifdef and go with
upstream flags, as that was added in mesa/drm@0d889201d106.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Create a new file for the DRM backend's handling of output modes, e.g.
resolution, aspect ratio, preferred mode selection, EDID parsing.
Signed-off-by: Daniel Stone <daniels@collabora.com>