^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) * Copyright (c) 2016 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Permission to use, copy, modify, distribute, and sell this software and its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * documentation for any purpose is hereby granted without fee, provided that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) * the above copyright notice appear in all copies and that both that copyright
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * notice and this permission notice appear in supporting documentation, and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * that the name of the copyright holders not be used in advertising or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * publicity pertaining to distribution of the software without specific,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * written prior permission. The copyright holders make no representations
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) * about the suitability of this software for any purpose. It is provided "as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) * is" without express or implied warranty.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * OF THIS SOFTWARE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #ifndef __DRM_CONNECTOR_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define __DRM_CONNECTOR_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <linux/list.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/llist.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <linux/ctype.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <linux/hdmi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <drm/drm_mode_object.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) #include <drm/drm_util.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #include <uapi/drm/drm_mode.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct drm_connector_helper_funcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct drm_modeset_acquire_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct drm_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct drm_crtc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct drm_encoder;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct drm_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) struct drm_property_blob;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct drm_printer;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct edid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct i2c_adapter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) enum drm_connector_force {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) DRM_FORCE_UNSPECIFIED,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) DRM_FORCE_OFF,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) DRM_FORCE_ON, /* force on analog part normally */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) * enum drm_connector_status - status for a &drm_connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * This enum is used to track the connector status. There are no separate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * #defines for the uapi!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) enum drm_connector_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * @connector_status_connected: The connector is definitely connected to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * a sink device, and can be enabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) connector_status_connected = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * @connector_status_disconnected: The connector isn't connected to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * sink device which can be autodetect. For digital outputs like DP or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * HDMI (which can be realiable probed) this means there's really
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * nothing there. It is driver-dependent whether a connector with this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * status can be lit up or not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) connector_status_disconnected = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * @connector_status_unknown: The connector's status could not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * reliably detected. This happens when probing would either cause
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) * flicker (like load-detection when the connector is in use), or when a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * hardware resource isn't available (like when load-detection needs a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) * free CRTC). It should be possible to light up the connector with one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) * of the listed fallback modes. For default configuration userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) * should only try to light up connectors with unknown status when
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) * there's not connector with @connector_status_connected.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) connector_status_unknown = 3,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * enum drm_connector_registration_status - userspace registration status for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) * a &drm_connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * This enum is used to track the status of initializing a connector and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) * registering it with userspace, so that DRM can prevent bogus modesets on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) * connectors that no longer exist.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) enum drm_connector_registration_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) * @DRM_CONNECTOR_INITIALIZING: The connector has just been created,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * but has yet to be exposed to userspace. There should be no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) * additional restrictions to how the state of this connector may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) * modified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) DRM_CONNECTOR_INITIALIZING = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * @DRM_CONNECTOR_REGISTERED: The connector has been fully initialized
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) * and registered with sysfs, as such it has been exposed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) * userspace. There should be no additional restrictions to how the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * state of this connector may be modified.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) DRM_CONNECTOR_REGISTERED = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * @DRM_CONNECTOR_UNREGISTERED: The connector has either been exposed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) * to userspace and has since been unregistered and removed from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * userspace, or the connector was unregistered before it had a chance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * to be exposed to userspace (e.g. still in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * @DRM_CONNECTOR_INITIALIZING state). When a connector is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * unregistered, there are additional restrictions to how its state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) * may be modified:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) * - An unregistered connector may only have its DPMS changed from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) * On->Off. Once DPMS is changed to Off, it may not be switched back
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) * to On.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * - Modesets are not allowed on unregistered connectors, unless they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) * would result in disabling its assigned CRTCs. This means
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) * disabling a CRTC on an unregistered connector is OK, but enabling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) * one is not.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * - Removing a CRTC from an unregistered connector is OK, but new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) * CRTCs may never be assigned to an unregistered connector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) DRM_CONNECTOR_UNREGISTERED = 2,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) enum subpixel_order {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) SubPixelUnknown = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) SubPixelHorizontalRGB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) SubPixelHorizontalBGR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) SubPixelVerticalRGB,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) SubPixelVerticalBGR,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) SubPixelNone,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * struct drm_scrambling: sink's scrambling support.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) struct drm_scrambling {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * @supported: scrambling supported for rates > 340 Mhz.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) bool supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * @low_rates: scrambling supported for rates <= 340 Mhz.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) bool low_rates;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * struct drm_scdc - Information about scdc capabilities of a HDMI 2.0 sink
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * Provides SCDC register support and capabilities related information on a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * HDMI 2.0 sink. In case of a HDMI 1.4 sink, all parameter must be 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) struct drm_scdc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * @supported: status control & data channel present.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) bool supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * @read_request: sink is capable of generating scdc read request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) bool read_request;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) * @scrambling: sink's scrambling capabilities
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) struct drm_scrambling scrambling;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) #ifdef CONFIG_NO_GKI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) * struct drm_hdmi_dsc_cap - DSC capabilities of HDMI sink
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) * Describes the DSC support provided by HDMI 2.1 sink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) * The information is fetched fom additional HFVSDB blocks defined
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) * for HDMI 2.1.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) struct drm_hdmi_dsc_cap {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) /** @v_1p2: flag for dsc1.2 version support by sink */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) bool v_1p2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) /** @native_420: Does sink support DSC with 4:2:0 compression */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) bool native_420;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) * @all_bpp: Does sink support all bpp with 4:4:4: or 4:2:2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) * compressed formats
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) bool all_bpp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) * @bpc_supported: compressed bpc supported by sink : 10, 12 or 16 bpc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) u8 bpc_supported;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) /** @max_slices: maximum number of Horizontal slices supported by */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) u8 max_slices;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) /** @clk_per_slice : max pixel clock in MHz supported per slice */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) int clk_per_slice;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) /** @max_lanes : dsc max lanes supported for Fixed rate Link training */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) u8 max_lanes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) /** @max_frl_rate_per_lane : maximum frl rate with DSC per lane */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) u8 max_frl_rate_per_lane;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) /** @total_chunk_kbytes: max size of chunks in KBs supported per line*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) u8 total_chunk_kbytes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) * struct drm_hdmi_info - runtime information about the connected HDMI sink
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) * Describes if a given display supports advanced HDMI 2.0 features.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) * This information is available in CEA-861-F extension blocks (like HF-VSDB).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) struct drm_hdmi_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) /** @scdc: sink's scdc support and capabilities */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) struct drm_scdc scdc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) * @y420_vdb_modes: bitmap of modes which can support ycbcr420
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) * output only (not normal RGB/YCBCR444/422 outputs). The max VIC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) * defined by the CEA-861-G spec is 219, so the size is 256 bits to map
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) * up to 256 VICs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) unsigned long y420_vdb_modes[BITS_TO_LONGS(256)];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) * @y420_cmdb_modes: bitmap of modes which can support ycbcr420
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) * output also, along with normal HDMI outputs. The max VIC defined by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) * the CEA-861-G spec is 219, so the size is 256 bits to map up to 256
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) * VICs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) unsigned long y420_cmdb_modes[BITS_TO_LONGS(256)];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) /** @y420_cmdb_map: bitmap of SVD index, to extraxt vcb modes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) u64 y420_cmdb_map;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) /** @y420_dc_modes: bitmap of deep color support index */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) u8 y420_dc_modes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) #ifdef CONFIG_NO_GKI
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /** @max_frl_rate_per_lane: support fixed rate link */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) u8 max_frl_rate_per_lane;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) /** @max_lanes: supported by sink */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) u8 max_lanes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) /** @dsc_cap: DSC capabilities of the sink */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) struct drm_hdmi_dsc_cap dsc_cap;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) * enum drm_link_status - connector's link_status property value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) * This enum is used as the connector's link status property value.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) * It is set to the values defined in uapi.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) * @DRM_LINK_STATUS_GOOD: DP Link is Good as a result of successful
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) * link training
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) * @DRM_LINK_STATUS_BAD: DP Link is BAD as a result of link training
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) * failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) enum drm_link_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) DRM_LINK_STATUS_GOOD = DRM_MODE_LINK_STATUS_GOOD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) DRM_LINK_STATUS_BAD = DRM_MODE_LINK_STATUS_BAD,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) * enum drm_panel_orientation - panel_orientation info for &drm_display_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) * This enum is used to track the (LCD) panel orientation. There are no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) * separate #defines for the uapi!
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) * @DRM_MODE_PANEL_ORIENTATION_UNKNOWN: The drm driver has not provided any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) * panel orientation information (normal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) * for non panels) in this case the "panel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) * orientation" connector prop will not be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) * attached.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) * @DRM_MODE_PANEL_ORIENTATION_NORMAL: The top side of the panel matches the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) * top side of the device's casing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) * @DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP: The top side of the panel matches the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) * bottom side of the device's casing, iow
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) * the panel is mounted upside-down.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) * @DRM_MODE_PANEL_ORIENTATION_LEFT_UP: The left side of the panel matches the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) * top side of the device's casing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) * @DRM_MODE_PANEL_ORIENTATION_RIGHT_UP: The right side of the panel matches the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) * top side of the device's casing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) enum drm_panel_orientation {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) DRM_MODE_PANEL_ORIENTATION_UNKNOWN = -1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) DRM_MODE_PANEL_ORIENTATION_NORMAL = 0,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) DRM_MODE_PANEL_ORIENTATION_LEFT_UP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) * struct drm_monitor_range_info - Panel's Monitor range in EDID for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) * &drm_display_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) * This struct is used to store a frequency range supported by panel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) * as parsed from EDID's detailed monitor range descriptor block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) * @min_vfreq: This is the min supported refresh rate in Hz from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) * EDID's detailed monitor range.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) * @max_vfreq: This is the max supported refresh rate in Hz from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) * EDID's detailed monitor range
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) struct drm_monitor_range_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) u8 min_vfreq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) u8 max_vfreq;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) * This is a consolidated colorimetry list supported by HDMI and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) * DP protocol standard. The respective connectors will register
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) * a property with the subset of this list (supported by that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) * respective protocol). Userspace will set the colorspace through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) * a colorspace property which will be created and exposed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) * userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 334) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 335)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 336) /* For Default case, driver will set the colorspace */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) #define DRM_MODE_COLORIMETRY_DEFAULT 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) /* CEA 861 Normal Colorimetry options */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) #define DRM_MODE_COLORIMETRY_NO_DATA 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) #define DRM_MODE_COLORIMETRY_SMPTE_170M_YCC 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) #define DRM_MODE_COLORIMETRY_BT709_YCC 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) /* CEA 861 Extended Colorimetry Options */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) #define DRM_MODE_COLORIMETRY_XVYCC_601 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) #define DRM_MODE_COLORIMETRY_XVYCC_709 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) #define DRM_MODE_COLORIMETRY_SYCC_601 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) #define DRM_MODE_COLORIMETRY_OPYCC_601 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) #define DRM_MODE_COLORIMETRY_OPRGB 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) #define DRM_MODE_COLORIMETRY_BT2020_CYCC 8
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) #define DRM_MODE_COLORIMETRY_BT2020_RGB 9
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) #define DRM_MODE_COLORIMETRY_BT2020_YCC 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) /* Additional Colorimetry extension added as part of CTA 861.G */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) /* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) #define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 13
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) #define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 14
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) #define DRM_MODE_COLORIMETRY_BT601_YCC 15
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) * enum drm_bus_flags - bus_flags info for &drm_display_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) * This enum defines signal polarities and clock edge information for signals on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) * a bus as bitmask flags.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) * The clock edge information is conveyed by two sets of symbols,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) * DRM_BUS_FLAGS_*_DRIVE_\* and DRM_BUS_FLAGS_*_SAMPLE_\*. When this enum is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) * used to describe a bus from the point of view of the transmitter, the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) * \*_DRIVE_\* flags should be used. When used from the point of view of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) * receiver, the \*_SAMPLE_\* flags should be used. The \*_DRIVE_\* and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370) * \*_SAMPLE_\* flags alias each other, with the \*_SAMPLE_POSEDGE and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) * \*_SAMPLE_NEGEDGE flags being equal to \*_DRIVE_NEGEDGE and \*_DRIVE_POSEDGE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) * respectively. This simplifies code as signals are usually sampled on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) * opposite edge of the driving edge. Transmitters and receivers may however
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) * need to take other signal timings into account to convert between driving
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) * and sample edges.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) enum drm_bus_flags {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) * @DRM_BUS_FLAG_DE_LOW:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) * The Data Enable signal is active low
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) DRM_BUS_FLAG_DE_LOW = BIT(0),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) * @DRM_BUS_FLAG_DE_HIGH:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) * The Data Enable signal is active high
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390) DRM_BUS_FLAG_DE_HIGH = BIT(1),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) * @DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) * Data is driven on the rising edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE = BIT(2),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 398)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 399) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 400) * @DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) * Data is driven on the falling edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE = BIT(3),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) * @DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) * Data is sampled on the rising edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE = DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414) * @DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) * Data is sampled on the falling edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421) * @DRM_BUS_FLAG_DATA_MSB_TO_LSB:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) * Data is transmitted MSB to LSB on the bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) DRM_BUS_FLAG_DATA_MSB_TO_LSB = BIT(4),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) * @DRM_BUS_FLAG_DATA_LSB_TO_MSB:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) * Data is transmitted LSB to MSB on the bus
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) DRM_BUS_FLAG_DATA_LSB_TO_MSB = BIT(5),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) * @DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) * Sync signals are driven on the rising edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE = BIT(6),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) * @DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) * Sync signals are driven on the falling edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE = BIT(7),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) * @DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) * Sync signals are sampled on the rising edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) * @DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458) * Sync signals are sampled on the falling edge of the pixel clock
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE = DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) * @DRM_BUS_FLAG_SHARP_SIGNALS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) * Set if the Sharp-specific signals (SPL, CLS, PS, REV) must be used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) DRM_BUS_FLAG_SHARP_SIGNALS = BIT(8),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) * struct drm_display_info - runtime data about the connected sink
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) * Describes a given display (e.g. CRT or flat panel) and its limitations. For
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474) * fixed display sinks like built-in panels there's not much difference between
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) * this and &struct drm_connector. But for sinks with a real cable this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) * structure is meant to describe all the things at the other end of the cable.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) * For sinks which provide an EDID this can be filled out by calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) * drm_add_edid_modes().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) struct drm_display_info {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) * @width_mm: Physical width in mm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) unsigned int width_mm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) * @height_mm: Physical height in mm.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490) unsigned int height_mm;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) * @bpc: Maximum bits per color channel. Used by HDMI and DP outputs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) unsigned int bpc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) * @subpixel_order: Subpixel order of LCD panels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) enum subpixel_order subpixel_order;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) #define DRM_COLOR_FORMAT_RGB444 (1<<0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) #define DRM_COLOR_FORMAT_YCRCB444 (1<<1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) #define DRM_COLOR_FORMAT_YCRCB422 (1<<2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505) #define DRM_COLOR_FORMAT_YCRCB420 (1<<3)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) * @panel_orientation: Read only connector property for built-in panels,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) * indicating the orientation of the panel vs the device's casing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) * drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) * When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) * fb to compensate and gets exported as prop to userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514) int panel_orientation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) * @color_formats: HDMI Color formats, selects between RGB and YCrCb
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) * modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) * as used to describe the pixel format in framebuffers, and also don't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) * match the formats in @bus_formats which are shared with v4l.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) u32 color_formats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) * @bus_formats: Pixel data format on the wire, somewhat redundant with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) * @color_formats. Array of size @num_bus_formats encoded using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) * MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) const u32 *bus_formats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) * @num_bus_formats: Size of @bus_formats array.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) unsigned int num_bus_formats;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 534)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 535) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 536) * @bus_flags: Additional information (like pixel signal polarity) for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) * the pixel data on the bus, using &enum drm_bus_flags values
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) * DRM_BUS_FLAGS\_.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) u32 bus_flags;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) * @max_tmds_clock: Maximum TMDS clock rate supported by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) * sink in kHz. 0 means undefined.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) int max_tmds_clock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) * @dvi_dual: Dual-link DVI sink?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) bool dvi_dual;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 552)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 553) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 554) * @is_hdmi: True if the sink is an HDMI device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) * This field shall be used instead of calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) * drm_detect_hdmi_monitor() when possible.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) bool is_hdmi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) * @has_hdmi_infoframe: Does the sink support the HDMI infoframe?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) bool has_hdmi_infoframe;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) * @rgb_quant_range_selectable: Does the sink support selecting
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) * the RGB quantization range?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) bool rgb_quant_range_selectable;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) * @edid_hdmi_dc_modes: Mask of supported hdmi deep color modes. Even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) * more stuff redundant with @bus_formats.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) u8 edid_hdmi_dc_modes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) * @cea_rev: CEA revision of the HDMI sink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) u8 cea_rev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) * @hdmi: advance features of a HDMI sink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) struct drm_hdmi_info hdmi;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) * @non_desktop: Non desktop display (HMD).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) bool non_desktop;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) * @monitor_range: Frequency range supported by monitor range descriptor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) struct drm_monitor_range_info monitor_range;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) int drm_display_info_set_bus_formats(struct drm_display_info *info,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) const u32 *formats,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) unsigned int num_formats);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) * struct drm_connector_tv_margins - TV connector related margins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) * Describes the margins in pixels to put around the image on TV
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) * connectors to deal with overscan.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) struct drm_connector_tv_margins {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) * @bottom: Bottom margin in pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) unsigned int bottom;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) * @left: Left margin in pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) unsigned int left;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) * @right: Right margin in pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) unsigned int right;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) * @top: Top margin in pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) unsigned int top;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) * struct drm_tv_connector_state - TV connector related states
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) * @subconnector: selected subconnector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) * @margins: TV margins
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) * @mode: TV mode
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) * @brightness: brightness in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) * @contrast: contrast in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) * @flicker_reduction: flicker reduction in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) * @overscan: overscan in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) * @saturation: saturation in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) * @hue: hue in percent
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) struct drm_tv_connector_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) enum drm_mode_subconnector subconnector;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) struct drm_connector_tv_margins margins;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) unsigned int mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) unsigned int brightness;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) unsigned int contrast;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) unsigned int flicker_reduction;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) unsigned int overscan;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) unsigned int saturation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) unsigned int hue;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) * struct drm_connector_state - mutable connector state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) struct drm_connector_state {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) /** @connector: backpointer to the connector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) struct drm_connector *connector;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) * @crtc: CRTC to connect connector to, NULL if disabled.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) * Do not change this directly, use drm_atomic_set_crtc_for_connector()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) * instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) struct drm_crtc *crtc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671) * @best_encoder:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) * Used by the atomic helpers to select the encoder, through the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) * &drm_connector_helper_funcs.atomic_best_encoder or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) * &drm_connector_helper_funcs.best_encoder callbacks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) * This is also used in the atomic helpers to map encoders to their
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) * current and previous connectors, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) * drm_atomic_get_old_connector_for_encoder() and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) * drm_atomic_get_new_connector_for_encoder().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682) * NOTE: Atomic drivers must fill this out (either themselves or through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) * not return correct data to userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) struct drm_encoder *best_encoder;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) * @link_status: Connector link_status to keep track of whether link is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) * GOOD or BAD to notify userspace if retraining is necessary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) enum drm_link_status link_status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) /** @state: backpointer to global drm_atomic_state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) struct drm_atomic_state *state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) * @commit: Tracks the pending commit to prevent use-after-free conditions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) * Is only set when @crtc is NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) struct drm_crtc_commit *commit;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) /** @tv: TV connector state */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) struct drm_tv_connector_state tv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) * @self_refresh_aware:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) * This tracks whether a connector is aware of the self refresh state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) * It should be set to true for those connector implementations which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) * understand the self refresh state. This is needed since the crtc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) * registers the self refresh helpers and it doesn't know if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) * connectors downstream have implemented self refresh entry/exit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) * Drivers should set this to true in atomic_check if they know how to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) * handle self_refresh requests.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) bool self_refresh_aware;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) * @picture_aspect_ratio: Connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) * HDMI infoframe aspect ratio setting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) * The %DRM_MODE_PICTURE_ASPECT_\* values much match the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) * values for &enum hdmi_picture_aspect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) enum hdmi_picture_aspect picture_aspect_ratio;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) * @content_type: Connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) * HDMI infoframe content type setting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) * The %DRM_MODE_CONTENT_TYPE_\* values much
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) * match the values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) unsigned int content_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) * @hdcp_content_type: Connector property to pass the type of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) * protected content. This is most commonly used for HDCP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) unsigned int hdcp_content_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) * @scaling_mode: Connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) * upscaling, mostly used for built-in panels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) unsigned int scaling_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) * @content_protection: Connector property to request content
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) * protection. This is most commonly used for HDCP.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) unsigned int content_protection;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) * @colorspace: State variable for Connector property to request
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) * colorspace change on Sink. This is most commonly used to switch
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) * to wider color gamuts like BT2020.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) u32 colorspace;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) * @writeback_job: Writeback job for writeback connectors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) * Holds the framebuffer and out-fence for a writeback connector. As
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) * the writeback completion may be asynchronous to the normal commit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) * cycle, the writeback job lifetime is managed separately from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) * normal atomic state by this object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) * See also: drm_writeback_queue_job() and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) * drm_writeback_signal_completion()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) struct drm_writeback_job *writeback_job;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) * @max_requested_bpc: Connector property to limit the maximum bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) * depth of the pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) u8 max_requested_bpc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) * @max_bpc: Connector max_bpc based on the requested max_bpc property
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) * and the connector bpc limitations obtained from edid.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) u8 max_bpc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) * @hdr_output_metadata:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) * DRM blob property for HDR output metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) struct drm_property_blob *hdr_output_metadata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796) * struct drm_connector_funcs - control connectors on a given device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) * Each CRTC may have one or more connectors attached to it. The functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) * below allow the core DRM code to control connectors, enumerate available modes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) * etc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) struct drm_connector_funcs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) * @dpms:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) * Legacy entry point to set the per-connector DPMS state. Legacy DPMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) * is exposed as a standard property on the connector, but diverted to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) * this callback in the drm core. Note that atomic drivers don't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809) * implement the 4 level DPMS support on the connector any more, but
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) * instead only have an on/off "ACTIVE" property on the CRTC object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) * This hook is not used by atomic drivers, remapping of the legacy DPMS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) * property is entirely handled in the DRM core.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) * 0 on success or a negative error code on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819) int (*dpms)(struct drm_connector *connector, int mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 820)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 821) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 822) * @reset:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) * Reset connector hardware and software state to off. This function isn't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) * called by the core directly, only through drm_mode_config_reset().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) * It's not a helper hook only for historical reasons.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) * Atomic drivers can use drm_atomic_helper_connector_reset() to reset
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829) * atomic state using this hook.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) void (*reset)(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834) * @detect:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) * Check to see if anything is attached to the connector. The parameter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837) * force is set to false whilst polling, true when checking the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) * connector due to a user request. force can be used by the driver to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839) * avoid expensive, destructive operations during automated probing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841) * This callback is optional, if not implemented the connector will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) * considered as always being attached.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) * FIXME:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) * Note that this hook is only called by the probe helper. It's not in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847) * the helper library vtable purely for historical reasons. The only DRM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) * core entry point to probe connector state is @fill_modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) * Note that the helper library will already hold
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) * &drm_mode_config.connection_mutex. Drivers which need to grab additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) * locks to avoid races with concurrent modeset changes need to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853) * &drm_connector_helper_funcs.detect_ctx instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857) * drm_connector_status indicating the connector's status.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859) enum drm_connector_status (*detect)(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) bool force);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) * @force:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865) * This function is called to update internal encoder state when the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) * connector is forced to a certain state by userspace, either through
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867) * the sysfs interfaces or on the kernel cmdline. In that case the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) * @detect callback isn't called.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870) * FIXME:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) * Note that this hook is only called by the probe helper. It's not in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) * the helper library vtable purely for historical reasons. The only DRM
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874) * core entry point to probe connector state is @fill_modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876) void (*force)(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879) * @fill_modes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881) * Entry point for output detection and basic mode validation. The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) * driver should reprobe the output if needed (e.g. when hotplug
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) * handling is unreliable), add all detected modes to &drm_connector.modes
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884) * and filter out any the device can't support in any configuration. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885) * also needs to filter out any modes wider or higher than the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886) * parameters max_width and max_height indicate.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) * The drivers must also prune any modes no longer valid from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) * &drm_connector.modes. Furthermore it must update
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) * &drm_connector.status and &drm_connector.edid. If no EDID has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) * received for this output connector->edid must be NULL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) * Drivers using the probe helpers should use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) * drm_helper_probe_single_connector_modes() to implement this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) * function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899) * The number of modes detected and filled into &drm_connector.modes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904) * @set_property:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906) * This is the legacy entry point to update a property attached to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907) * connector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909) * This callback is optional if the driver does not support any legacy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910) * driver-private properties. For atomic drivers it is not used because
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911) * property handling is done entirely in the DRM core.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915) * 0 on success or a negative error code on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917) int (*set_property)(struct drm_connector *connector, struct drm_property *property,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918) uint64_t val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921) * @late_register:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923) * This optional hook can be used to register additional userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) * interfaces attached to the connector, light backlight control, i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) * DP aux or similar interfaces. It is called late in the driver load
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926) * sequence from drm_connector_register() when registering all the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927) * core drm connector interfaces. Everything added from this callback
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928) * should be unregistered in the early_unregister callback.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930) * This is called while holding &drm_connector.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934) * 0 on success, or a negative error code on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) int (*late_register)(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939) * @early_unregister:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941) * This optional hook should be used to unregister the additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) * userspace interfaces attached to the connector from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943) * late_register(). It is called from drm_connector_unregister(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944) * early in the driver unload sequence to disable userspace access
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) * before data structures are torndown.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947) * This is called while holding &drm_connector.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949) void (*early_unregister)(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 950)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 951) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 952) * @destroy:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954) * Clean up connector resources. This is called at driver unload time
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955) * through drm_mode_config_cleanup(). It can also be called at runtime
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956) * when a connector is being hot-unplugged for drivers that support
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957) * connector hotplugging (e.g. DisplayPort MST).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959) void (*destroy)(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962) * @atomic_duplicate_state:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964) * Duplicate the current atomic state for this connector and return it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965) * The core and helpers guarantee that any atomic state duplicated with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966) * this hook and still owned by the caller (i.e. not transferred to the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967) * driver by calling &drm_mode_config_funcs.atomic_commit) will be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) * cleaned up by calling the @atomic_destroy_state hook in this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969) * structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971) * This callback is mandatory for atomic drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) * Atomic drivers which don't subclass &struct drm_connector_state should use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974) * drm_atomic_helper_connector_duplicate_state(). Drivers that subclass the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) * state structure to extend it with driver-private state should use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) * __drm_atomic_helper_connector_duplicate_state() to make sure shared state is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977) * duplicated in a consistent fashion across drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979) * It is an error to call this hook before &drm_connector.state has been
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980) * initialized correctly.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982) * NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 984) * If the duplicate state references refcounted resources this hook must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 985) * acquire a reference for each of them. The driver must release these
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 986) * references again in @atomic_destroy_state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 987) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 988) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 989) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 990) * Duplicated atomic state or NULL when the allocation failed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 991) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 992) struct drm_connector_state *(*atomic_duplicate_state)(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 993)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 994) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 995) * @atomic_destroy_state:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 996) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 997) * Destroy a state duplicated with @atomic_duplicate_state and release
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 998) * or unreference all resources it references
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 999) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1000) * This callback is mandatory for atomic drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1001) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1002) void (*atomic_destroy_state)(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1003) struct drm_connector_state *state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1004)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1005) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1006) * @atomic_set_property:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1007) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1008) * Decode a driver-private property value and store the decoded value
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1009) * into the passed-in state structure. Since the atomic core decodes all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1010) * standardized properties (even for extensions beyond the core set of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1011) * properties which might not be implemented by all drivers) this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1012) * requires drivers to subclass the state structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1013) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1014) * Such driver-private properties should really only be implemented for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1015) * truly hardware/vendor specific state. Instead it is preferred to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1016) * standardize atomic extension and decode the properties used to expose
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1017) * such an extension in the core.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1018) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1019) * Do not call this function directly, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1020) * drm_atomic_connector_set_property() instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1021) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1022) * This callback is optional if the driver does not support any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1023) * driver-private atomic properties.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1024) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1025) * NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1026) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1027) * This function is called in the state assembly phase of atomic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1028) * modesets, which can be aborted for any reason (including on
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1029) * userspace's request to just check whether a configuration would be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1030) * possible). Drivers MUST NOT touch any persistent state (hardware or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1031) * software) or data structures except the passed in @state parameter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1032) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1033) * Also since userspace controls in which order properties are set this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1034) * function must not do any input validation (since the state update is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1035) * incomplete and hence likely inconsistent). Instead any such input
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1036) * validation must be done in the various atomic_check callbacks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1037) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1038) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1039) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1040) * 0 if the property has been found, -EINVAL if the property isn't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1041) * implemented by the driver (which shouldn't ever happen, the core only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1042) * asks for properties attached to this connector). No other validation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1043) * is allowed by the driver. The core already checks that the property
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1044) * value is within the range (integer, valid enum value, ...) the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1045) * set when registering the property.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1046) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1047) int (*atomic_set_property)(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1048) struct drm_connector_state *state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1049) struct drm_property *property,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1050) uint64_t val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1051)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1052) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1053) * @atomic_get_property:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1054) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1055) * Reads out the decoded driver-private property. This is used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1056) * implement the GETCONNECTOR IOCTL.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1057) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1058) * Do not call this function directly, use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1059) * drm_atomic_connector_get_property() instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1060) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1061) * This callback is optional if the driver does not support any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1062) * driver-private atomic properties.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1063) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1064) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1065) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1066) * 0 on success, -EINVAL if the property isn't implemented by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1067) * driver (which shouldn't ever happen, the core only asks for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1068) * properties attached to this connector).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1069) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1070) int (*atomic_get_property)(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1071) const struct drm_connector_state *state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1072) struct drm_property *property,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1073) uint64_t *val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1074)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1075) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1076) * @atomic_print_state:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1077) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1078) * If driver subclasses &struct drm_connector_state, it should implement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1079) * this optional hook for printing additional driver specific state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1080) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1081) * Do not call this directly, use drm_atomic_connector_print_state()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1082) * instead.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1083) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1084) void (*atomic_print_state)(struct drm_printer *p,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1085) const struct drm_connector_state *state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1086) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1087)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1088) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1089) * struct drm_cmdline_mode - DRM Mode passed through the kernel command-line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1090) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1091) * Each connector can have an initial mode with additional options
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1092) * passed through the kernel command line. This structure allows to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1093) * express those parameters and will be filled by the command-line
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1094) * parser.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1095) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1096) struct drm_cmdline_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1097) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1098) * @name:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1099) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1100) * Name of the mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1101) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1102) char name[DRM_DISPLAY_MODE_LEN];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1104) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1105) * @specified:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1106) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1107) * Has a mode been read from the command-line?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1108) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1109) bool specified;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1111) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1112) * @refresh_specified:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1113) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1114) * Did the mode have a preferred refresh rate?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1115) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1116) bool refresh_specified;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1117)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1118) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1119) * @bpp_specified:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1120) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1121) * Did the mode have a preferred BPP?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1122) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1123) bool bpp_specified;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1124)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1125) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1126) * @xres:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1127) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1128) * Active resolution on the X axis, in pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1129) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1130) int xres;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1131)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1132) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1133) * @yres:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1134) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1135) * Active resolution on the Y axis, in pixels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1136) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1137) int yres;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1139) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1140) * @bpp:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1141) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1142) * Bits per pixels for the mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1143) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1144) int bpp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1145)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1146) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1147) * @refresh:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1148) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1149) * Refresh rate, in Hertz.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1150) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1151) int refresh;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1152)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1153) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1154) * @rb:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1155) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1156) * Do we need to use reduced blanking?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1157) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1158) bool rb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1159)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1160) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1161) * @interlace:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1162) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1163) * The mode is interlaced.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1164) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1165) bool interlace;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1167) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1168) * @cvt:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1169) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1170) * The timings will be calculated using the VESA Coordinated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1171) * Video Timings instead of looking up the mode from a table.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1172) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1173) bool cvt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1174)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1175) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1176) * @margins:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1177) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1178) * Add margins to the mode calculation (1.8% of xres rounded
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1179) * down to 8 pixels and 1.8% of yres).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1180) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1181) bool margins;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1182)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1183) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1184) * @force:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1185) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1186) * Ignore the hotplug state of the connector, and force its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1187) * state to one of the DRM_FORCE_* values.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1188) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1189) enum drm_connector_force force;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1191) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1192) * @rotation_reflection:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1193) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1194) * Initial rotation and reflection of the mode setup from the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1195) * command line. See DRM_MODE_ROTATE_* and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1196) * DRM_MODE_REFLECT_*. The only rotations supported are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1197) * DRM_MODE_ROTATE_0 and DRM_MODE_ROTATE_180.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1198) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1199) unsigned int rotation_reflection;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1200)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1201) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1202) * @panel_orientation:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1203) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1204) * drm-connector "panel orientation" property override value,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1205) * DRM_MODE_PANEL_ORIENTATION_UNKNOWN if not set.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1206) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1207) enum drm_panel_orientation panel_orientation;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1208)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1209) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1210) * @tv_margins: TV margins to apply to the mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1211) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1212) struct drm_connector_tv_margins tv_margins;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1213) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1215) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1216) * struct drm_connector - central DRM connector control structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1217) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1218) * Each connector may be connected to one or more CRTCs, or may be clonable by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1219) * another connector if they can share a CRTC. Each connector also has a specific
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1220) * position in the broader display (referred to as a 'screen' though it could
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1221) * span multiple monitors).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1222) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1223) struct drm_connector {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1224) /** @dev: parent DRM device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1225) struct drm_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1226) /** @kdev: kernel device for sysfs attributes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1227) struct device *kdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1228) /** @attr: sysfs attributes */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1229) struct device_attribute *attr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1230)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1231) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1232) * @head:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1233) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1234) * List of all connectors on a @dev, linked from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1235) * &drm_mode_config.connector_list. Protected by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1236) * &drm_mode_config.connector_list_lock, but please only use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1237) * &drm_connector_list_iter to walk this list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1238) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1239) struct list_head head;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1240)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1241) /** @base: base KMS object */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1242) struct drm_mode_object base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1243)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1244) /** @name: human readable name, can be overwritten by the driver */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1245) char *name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1246)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1247) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1248) * @mutex: Lock for general connector state, but currently only protects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1249) * @registered. Most of the connector state is still protected by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1250) * &drm_mode_config.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1251) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1252) struct mutex mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1253)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1254) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1255) * @index: Compacted connector index, which matches the position inside
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1256) * the mode_config.list for drivers not supporting hot-add/removing. Can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1257) * be used as an array index. It is invariant over the lifetime of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1258) * connector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1259) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1260) unsigned index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1262) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1263) * @connector_type:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1264) * one of the DRM_MODE_CONNECTOR_<foo> types from drm_mode.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1265) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1266) int connector_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1267) /** @connector_type_id: index into connector type enum */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1268) int connector_type_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1269) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1270) * @interlace_allowed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1271) * Can this connector handle interlaced modes? Only used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1272) * drm_helper_probe_single_connector_modes() for mode filtering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1273) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1274) bool interlace_allowed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1275) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1276) * @doublescan_allowed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1277) * Can this connector handle doublescan? Only used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1278) * drm_helper_probe_single_connector_modes() for mode filtering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1279) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1280) bool doublescan_allowed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1281) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1282) * @stereo_allowed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1283) * Can this connector handle stereo modes? Only used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1284) * drm_helper_probe_single_connector_modes() for mode filtering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1285) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1286) bool stereo_allowed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1287)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1288) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1289) * @ycbcr_420_allowed : This bool indicates if this connector is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1290) * capable of handling YCBCR 420 output. While parsing the EDID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1291) * blocks it's very helpful to know if the source is capable of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1292) * handling YCBCR 420 outputs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1293) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1294) bool ycbcr_420_allowed;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1295)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1296) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1297) * @registration_state: Is this connector initializing, exposed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1298) * (registered) with userspace, or unregistered?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1299) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1300) * Protected by @mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1301) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1302) enum drm_connector_registration_state registration_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1303)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1304) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1305) * @modes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1306) * Modes available on this connector (from fill_modes() + user).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1307) * Protected by &drm_mode_config.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1308) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1309) struct list_head modes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1310)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1311) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1312) * @status:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1313) * One of the drm_connector_status enums (connected, not, or unknown).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1314) * Protected by &drm_mode_config.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1315) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1316) enum drm_connector_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1317)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1318) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1319) * @probed_modes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1320) * These are modes added by probing with DDC or the BIOS, before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1321) * filtering is applied. Used by the probe helpers. Protected by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1322) * &drm_mode_config.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1323) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1324) struct list_head probed_modes;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1325)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1326) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1327) * @display_info: Display information is filled from EDID information
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1328) * when a display is detected. For non hot-pluggable displays such as
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1329) * flat panels in embedded systems, the driver should initialize the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1330) * &drm_display_info.width_mm and &drm_display_info.height_mm fields
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1331) * with the physical size of the display.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1332) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1333) * Protected by &drm_mode_config.mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1334) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1335) struct drm_display_info display_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1336)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1337) /** @funcs: connector control functions */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1338) const struct drm_connector_funcs *funcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1339)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1340) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1341) * @edid_blob_ptr: DRM property containing EDID if present. Protected by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1342) * &drm_mode_config.mutex. This should be updated only by calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1343) * drm_connector_update_edid_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1344) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1345) struct drm_property_blob *edid_blob_ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1346)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1347) /** @properties: property tracking for this connector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1348) struct drm_object_properties properties;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1349)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1350) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1351) * @scaling_mode_property: Optional atomic property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1352) * upscaling. See drm_connector_attach_content_protection_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1353) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1354) struct drm_property *scaling_mode_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1355)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1356) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1357) * @vrr_capable_property: Optional property to help userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1358) * query hardware support for variable refresh rate on a connector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1359) * connector. Drivers can add the property to a connector by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1360) * calling drm_connector_attach_vrr_capable_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1361) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1362) * This should be updated only by calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1363) * drm_connector_set_vrr_capable_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1364) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1365) struct drm_property *vrr_capable_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1366)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1367) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1368) * @colorspace_property: Connector property to set the suitable
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1369) * colorspace supported by the sink.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1370) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1371) struct drm_property *colorspace_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1372)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1373) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1374) * @path_blob_ptr:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1375) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1376) * DRM blob property data for the DP MST path property. This should only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1377) * be updated by calling drm_connector_set_path_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1378) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1379) struct drm_property_blob *path_blob_ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1380)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1381) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1382) * @max_bpc_property: Default connector property for the max bpc to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1383) * driven out of the connector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1384) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1385) struct drm_property *max_bpc_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1386)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1387) #define DRM_CONNECTOR_POLL_HPD (1 << 0)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1388) #define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1389) #define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1390)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1391) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1392) * @polled:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1393) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1394) * Connector polling mode, a combination of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1395) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1396) * DRM_CONNECTOR_POLL_HPD
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1397) * The connector generates hotplug events and doesn't need to be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1398) * periodically polled. The CONNECT and DISCONNECT flags must not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1399) * be set together with the HPD flag.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1400) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1401) * DRM_CONNECTOR_POLL_CONNECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1402) * Periodically poll the connector for connection.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1403) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1404) * DRM_CONNECTOR_POLL_DISCONNECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1405) * Periodically poll the connector for disconnection, without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1406) * causing flickering even when the connector is in use. DACs should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1407) * rarely do this without a lot of testing.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1408) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1409) * Set to 0 for connectors that don't support connection status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1410) * discovery.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1411) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1412) uint8_t polled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1413)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1414) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1415) * @dpms: Current dpms state. For legacy drivers the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1416) * &drm_connector_funcs.dpms callback must update this. For atomic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1417) * drivers, this is handled by the core atomic code, and drivers must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1418) * only take &drm_crtc_state.active into account.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1419) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1420) int dpms;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1421)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1422) /** @helper_private: mid-layer private data */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1423) const struct drm_connector_helper_funcs *helper_private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1424)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1425) /** @cmdline_mode: mode line parsed from the kernel cmdline for this connector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1426) struct drm_cmdline_mode cmdline_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1427) /** @force: a DRM_FORCE_<foo> state for forced mode sets */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1428) enum drm_connector_force force;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1429) /** @override_edid: has the EDID been overwritten through debugfs for testing? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1430) bool override_edid;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1431) /** @epoch_counter: used to detect any other changes in connector, besides status */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1432) u64 epoch_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1433)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1434) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1435) * @possible_encoders: Bit mask of encoders that can drive this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1436) * connector, drm_encoder_index() determines the index into the bitfield
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1437) * and the bits are set with drm_connector_attach_encoder().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1438) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1439) u32 possible_encoders;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1440)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1441) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1442) * @encoder: Currently bound encoder driving this connector, if any.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1443) * Only really meaningful for non-atomic drivers. Atomic drivers should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1444) * instead look at &drm_connector_state.best_encoder, and in case they
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1445) * need the CRTC driving this output, &drm_connector_state.crtc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1446) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1447) struct drm_encoder *encoder;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1448)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1449) #define MAX_ELD_BYTES 128
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1450) /** @eld: EDID-like data, if present */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1451) uint8_t eld[MAX_ELD_BYTES];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1452) /** @latency_present: AV delay info from ELD, if found */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1453) bool latency_present[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1454) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1455) * @video_latency: Video latency info from ELD, if found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1456) * [0]: progressive, [1]: interlaced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1457) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1458) int video_latency[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1459) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1460) * @audio_latency: audio latency info from ELD, if found
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1461) * [0]: progressive, [1]: interlaced
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1462) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1463) int audio_latency[2];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1464)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1465) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1466) * @ddc: associated ddc adapter.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1467) * A connector usually has its associated ddc adapter. If a driver uses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1468) * this field, then an appropriate symbolic link is created in connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1469) * sysfs directory to make it easy for the user to tell which i2c
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1470) * adapter is for a particular display.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1471) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1472) * The field should be set by calling drm_connector_init_with_ddc().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1473) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1474) struct i2c_adapter *ddc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1475)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1476) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1477) * @null_edid_counter: track sinks that give us all zeros for the EDID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1478) * Needed to workaround some HW bugs where we get all 0s
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1479) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1480) int null_edid_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1481)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1482) /** @bad_edid_counter: track sinks that give us an EDID with invalid checksum */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1483) unsigned bad_edid_counter;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1484)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1485) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1486) * @edid_corrupt: Indicates whether the last read EDID was corrupt. Used
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1487) * in Displayport compliance testing - Displayport Link CTS Core 1.2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1488) * rev1.1 4.2.2.6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1489) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1490) bool edid_corrupt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1491) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1492) * @real_edid_checksum: real edid checksum for corrupted edid block.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1493) * Required in Displayport 1.4 compliance testing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1494) * rev1.1 4.2.2.6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1495) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1496) u8 real_edid_checksum;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1497)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1498) /** @debugfs_entry: debugfs directory for this connector */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1499) struct dentry *debugfs_entry;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1500)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1501) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1502) * @state:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1503) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1504) * Current atomic state for this connector.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1505) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1506) * This is protected by &drm_mode_config.connection_mutex. Note that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1507) * nonblocking atomic commits access the current connector state without
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1508) * taking locks. Either by going through the &struct drm_atomic_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1509) * pointers, see for_each_oldnew_connector_in_state(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1510) * for_each_old_connector_in_state() and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1511) * for_each_new_connector_in_state(). Or through careful ordering of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1512) * atomic commit operations as implemented in the atomic helpers, see
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1513) * &struct drm_crtc_commit.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1514) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1515) struct drm_connector_state *state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1516)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1517) /* DisplayID bits. FIXME: Extract into a substruct? */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1518)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1519) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1520) * @tile_blob_ptr:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1521) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1522) * DRM blob property data for the tile property (used mostly by DP MST).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1523) * This is meant for screens which are driven through separate display
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1524) * pipelines represented by &drm_crtc, which might not be running with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1525) * genlocked clocks. For tiled panels which are genlocked, like
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1526) * dual-link LVDS or dual-link DSI, the driver should try to not expose
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1527) * the tiling and virtualize both &drm_crtc and &drm_plane if needed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1528) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1529) * This should only be updated by calling
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1530) * drm_connector_set_tile_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1531) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1532) struct drm_property_blob *tile_blob_ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1533)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1534) /** @has_tile: is this connector connected to a tiled monitor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1535) bool has_tile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1536) /** @tile_group: tile group for the connected monitor */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1537) struct drm_tile_group *tile_group;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1538) /** @tile_is_single_monitor: whether the tile is one monitor housing */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1539) bool tile_is_single_monitor;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1540)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1541) /** @num_h_tile: number of horizontal tiles in the tile group */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1542) /** @num_v_tile: number of vertical tiles in the tile group */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1543) uint8_t num_h_tile, num_v_tile;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1544) /** @tile_h_loc: horizontal location of this tile */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1545) /** @tile_v_loc: vertical location of this tile */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1546) uint8_t tile_h_loc, tile_v_loc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1547) /** @tile_h_size: horizontal size of this tile. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1548) /** @tile_v_size: vertical size of this tile. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1549) uint16_t tile_h_size, tile_v_size;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1550)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1551) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1552) * @free_node:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1553) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1554) * List used only by &drm_connector_list_iter to be able to clean up a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1555) * connector from any context, in conjunction with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1556) * &drm_mode_config.connector_free_work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1557) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1558) struct llist_node free_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1559)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1560) /** @hdr_sink_metadata: HDR Metadata Information read from sink */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1561) struct hdr_sink_metadata hdr_sink_metadata;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1562) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1563)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1564) #define obj_to_connector(x) container_of(x, struct drm_connector, base)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1565)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1566) int drm_connector_init(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1567) struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1568) const struct drm_connector_funcs *funcs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1569) int connector_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1570) int drm_connector_init_with_ddc(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1571) struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1572) const struct drm_connector_funcs *funcs,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1573) int connector_type,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1574) struct i2c_adapter *ddc);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1575) void drm_connector_attach_edid_property(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1576) int drm_connector_register(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1577) void drm_connector_unregister(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1578) int drm_connector_attach_encoder(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1579) struct drm_encoder *encoder);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1580)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1581) void drm_connector_cleanup(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1582)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1583) static inline unsigned int drm_connector_index(const struct drm_connector *connector)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1584) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1585) return connector->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1586) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1587)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1588) static inline u32 drm_connector_mask(const struct drm_connector *connector)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1589) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1590) return 1 << connector->index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1591) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1592)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1593) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1594) * drm_connector_lookup - lookup connector object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1595) * @dev: DRM device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1596) * @file_priv: drm file to check for lease against.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1597) * @id: connector object id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1598) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1599) * This function looks up the connector object specified by id
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1600) * add takes a reference to it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1601) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1602) static inline struct drm_connector *drm_connector_lookup(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1603) struct drm_file *file_priv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1604) uint32_t id)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1605) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1606) struct drm_mode_object *mo;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1607) mo = drm_mode_object_find(dev, file_priv, id, DRM_MODE_OBJECT_CONNECTOR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1608) return mo ? obj_to_connector(mo) : NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1609) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1610)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1611) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1612) * drm_connector_get - acquire a connector reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1613) * @connector: DRM connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1614) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1615) * This function increments the connector's refcount.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1616) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1617) static inline void drm_connector_get(struct drm_connector *connector)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1618) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1619) drm_mode_object_get(&connector->base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1620) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1621)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1622) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1623) * drm_connector_put - release a connector reference
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1624) * @connector: DRM connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1625) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1626) * This function decrements the connector's reference count and frees the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1627) * object if the reference count drops to zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1628) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1629) static inline void drm_connector_put(struct drm_connector *connector)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1630) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1631) drm_mode_object_put(&connector->base);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1632) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1633)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1634) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1635) * drm_connector_is_unregistered - has the connector been unregistered from
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1636) * userspace?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1637) * @connector: DRM connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1638) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1639) * Checks whether or not @connector has been unregistered from userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1640) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1641) * Returns:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1642) * True if the connector was unregistered, false if the connector is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1643) * registered or has not yet been registered with userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1644) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1645) static inline bool
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1646) drm_connector_is_unregistered(struct drm_connector *connector)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1647) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1648) return READ_ONCE(connector->registration_state) ==
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1649) DRM_CONNECTOR_UNREGISTERED;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1650) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1651)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1652) void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1653) const char *drm_get_connector_type_name(unsigned int connector_type);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1654) const char *drm_get_connector_status_name(enum drm_connector_status status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1655) const char *drm_get_subpixel_order_name(enum subpixel_order order);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1656) const char *drm_get_dpms_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1657) const char *drm_get_dvi_i_subconnector_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1658) const char *drm_get_dvi_i_select_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1659) const char *drm_get_tv_subconnector_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1660) const char *drm_get_tv_select_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1661) const char *drm_get_dp_subconnector_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1662) const char *drm_get_content_protection_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1663) const char *drm_get_hdcp_content_type_name(int val);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1664)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1665) int drm_mode_create_dvi_i_properties(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1666) void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1667)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1668) int drm_mode_create_tv_margin_properties(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1669) int drm_mode_create_tv_properties(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1670) unsigned int num_modes,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1671) const char * const modes[]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1672) void drm_connector_attach_tv_margin_properties(struct drm_connector *conn);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1673) int drm_mode_create_scaling_mode_property(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1674) int drm_connector_attach_content_type_property(struct drm_connector *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1675) int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1676) u32 scaling_mode_mask);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1677) int drm_connector_attach_vrr_capable_property(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1678) struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1679) int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1680) int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1681) int drm_mode_create_dp_colorspace_property(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1682) int drm_mode_create_content_type_property(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1683) void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1684) const struct drm_connector_state *conn_state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1685)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1686) int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1687)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1688) int drm_connector_set_path_property(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1689) const char *path);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1690) int drm_connector_set_tile_property(struct drm_connector *connector);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1691) int drm_connector_update_edid_property(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1692) const struct edid *edid);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1693) void drm_connector_set_link_status_property(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1694) uint64_t link_status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1695) void drm_connector_set_vrr_capable_property(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1696) struct drm_connector *connector, bool capable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1697) int drm_connector_set_panel_orientation(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1698) struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1699) enum drm_panel_orientation panel_orientation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1700) int drm_connector_set_panel_orientation_with_quirk(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1701) struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1702) enum drm_panel_orientation panel_orientation,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1703) int width, int height);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1704) int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1705) int min, int max);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1706)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1707) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1708) * struct drm_tile_group - Tile group metadata
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1709) * @refcount: reference count
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1710) * @dev: DRM device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1711) * @id: tile group id exposed to userspace
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1712) * @group_data: Sink-private data identifying this group
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1713) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1714) * @group_data corresponds to displayid vend/prod/serial for external screens
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1715) * with an EDID.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1716) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1717) struct drm_tile_group {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1718) struct kref refcount;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1719) struct drm_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1720) int id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1721) u8 group_data[8];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1722) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1723)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1724) struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1725) const char topology[8]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1726) struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1727) const char topology[8]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1728) void drm_mode_put_tile_group(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1729) struct drm_tile_group *tg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1730)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1731) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1732) * struct drm_connector_list_iter - connector_list iterator
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1733) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1734) * This iterator tracks state needed to be able to walk the connector_list
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1735) * within struct drm_mode_config. Only use together with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1736) * drm_connector_list_iter_begin(), drm_connector_list_iter_end() and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1737) * drm_connector_list_iter_next() respectively the convenience macro
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1738) * drm_for_each_connector_iter().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1739) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1740) struct drm_connector_list_iter {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1741) /* private: */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1742) struct drm_device *dev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1743) struct drm_connector *conn;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1744) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1745)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1746) void drm_connector_list_iter_begin(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1747) struct drm_connector_list_iter *iter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1748) struct drm_connector *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1749) drm_connector_list_iter_next(struct drm_connector_list_iter *iter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1750) void drm_connector_list_iter_end(struct drm_connector_list_iter *iter);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1751)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1752) bool drm_connector_has_possible_encoder(struct drm_connector *connector,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1753) struct drm_encoder *encoder);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1754)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1755) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1756) * drm_for_each_connector_iter - connector_list iterator macro
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1757) * @connector: &struct drm_connector pointer used as cursor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1758) * @iter: &struct drm_connector_list_iter
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1759) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1760) * Note that @connector is only valid within the list body, if you want to use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1761) * @connector after calling drm_connector_list_iter_end() then you need to grab
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1762) * your own reference first using drm_connector_get().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1763) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1764) #define drm_for_each_connector_iter(connector, iter) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1765) while ((connector = drm_connector_list_iter_next(iter)))
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1766)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1767) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1768) * drm_connector_for_each_possible_encoder - iterate connector's possible encoders
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1769) * @connector: &struct drm_connector pointer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1770) * @encoder: &struct drm_encoder pointer used as cursor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1771) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1772) #define drm_connector_for_each_possible_encoder(connector, encoder) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1773) drm_for_each_encoder_mask(encoder, (connector)->dev, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1774) (connector)->possible_encoders)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1775)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1776) #endif