^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_MODE_CONFIG_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define __DRM_MODE_CONFIG_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #include <linux/mutex.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #include <linux/idr.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #include <linux/workqueue.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #include <linux/llist.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #include <drm/drm_modeset_lock.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) struct drm_file;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) struct drm_device;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct drm_atomic_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct drm_mode_fb_cmd2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) struct drm_format_info;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct drm_display_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * struct drm_mode_config_funcs - basic driver provided mode setting functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) * involve drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct drm_mode_config_funcs {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) * @fb_create:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) * Create a new framebuffer object. The core does basic checks on the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) * requested metadata, but most of that is left to the driver. See
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) * &struct drm_mode_fb_cmd2 for details.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) * To validate the pixel format and modifier drivers can use
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) * drm_any_plane_has_format() to make sure at least one plane supports
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) * the requested values. Note that the driver must first determine the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) * actual modifier used if the request doesn't have it specified,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) * ie. when (@mode_cmd->flags & DRM_MODE_FB_MODIFIERS) == 0.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) * If the parameters are deemed valid and the backing storage objects in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) * the underlying memory manager all exist, then the driver allocates
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) * a new &drm_framebuffer structure, subclassed to contain
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * driver-specific information (like the internal native buffer object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) * references). It also needs to fill out all relevant metadata, which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * should be done by calling drm_helper_mode_fill_fb_struct().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * The initialization is finalized by calling drm_framebuffer_init(),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * which registers the framebuffer and makes it accessible to other
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * threads.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * A new framebuffer with an initial reference count of 1 or a negative
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * error code encoded with ERR_PTR().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct drm_file *file_priv,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) const struct drm_mode_fb_cmd2 *mode_cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) * @get_format_info:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) * Allows a driver to return custom format information for special
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) * fb layouts (eg. ones with auxiliary compression control planes).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * The format information specific to the given fb metadata, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * NULL if none is found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) const struct drm_format_info *(*get_format_info)(const struct drm_mode_fb_cmd2 *mode_cmd);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95) * @output_poll_changed:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) * Callback used by helpers to inform the driver of output configuration
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) * changes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) * Drivers implementing fbdev emulation with the helpers can call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) * drm_fb_helper_hotplug_changed from this hook to inform the fbdev
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) * helper of output changes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) * FIXME:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) * Except that there's no vtable for device-level helper callbacks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) * there's no reason this is a core function.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) void (*output_poll_changed)(struct drm_device *dev);
^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) * @mode_valid:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * Device specific validation of display modes. Can be used to reject
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) * modes that can never be supported. Only device wide constraints can
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * be checked here. crtc/encoder/bridge/connector specific constraints
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * should be checked in the .mode_valid() hook for each specific object.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) enum drm_mode_status (*mode_valid)(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) const struct drm_display_mode *mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) * @atomic_check:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) * This is the only hook to validate an atomic modeset update. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) * function must reject any modeset and state changes which the hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) * or driver doesn't support. This includes but is of course not limited
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) * to:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130) * - Checking that the modes, framebuffers, scaling and placement
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) * requirements and so on are within the limits of the hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) * - Checking that any hidden shared resources are not oversubscribed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) * This can be shared PLLs, shared lanes, overall memory bandwidth,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) * display fifo space (where shared between planes or maybe even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) * CRTCs).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) * - Checking that virtualized resources exported to userspace are not
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) * oversubscribed. For various reasons it can make sense to expose
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) * more planes, crtcs or encoders than which are physically there. One
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) * example is dual-pipe operations (which generally should be hidden
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) * from userspace if when lockstepped in hardware, exposed otherwise),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) * where a plane might need 1 hardware plane (if it's just on one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) * pipe), 2 hardware planes (when it spans both pipes) or maybe even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) * shared a hardware plane with a 2nd plane (if there's a compatible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146) * plane requested on the area handled by the other pipe).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) * - Check that any transitional state is possible and that if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * requested, the update can indeed be done in the vblank period
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) * without temporarily disabling some functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * - Check any other constraints the driver or hardware might have.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * - This callback also needs to correctly fill out the &drm_crtc_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * in this update to make sure that drm_atomic_crtc_needs_modeset()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) * reflects the nature of the possible update and returns true if and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * only if the update cannot be applied without tearing within one
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) * vblank on that CRTC. The core uses that information to reject
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * updates which require a full modeset (i.e. blanking the screen, or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) * at least pausing updates for a substantial amount of time) if
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * userspace has disallowed that in its request.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * - The driver also does not need to repeat basic input validation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) * like done for the corresponding legacy entry points. The core does
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) * that before calling this hook.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) * See the documentation of @atomic_commit for an exhaustive list of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) * error conditions which don't have to be checked at the in this
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) * callback.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) * See the documentation for &struct drm_atomic_state for how exactly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) * an atomic modeset update is described.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) * Drivers using the atomic helpers can implement this hook using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) * drm_atomic_helper_check(), or one of the exported sub-functions of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) * it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) * 0 on success or one of the below negative error codes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) * - -EINVAL, if any of the above constraints are violated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184) * - -EDEADLK, when returned from an attempt to acquire an additional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) * &drm_modeset_lock through drm_modeset_lock().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) * - -ENOMEM, if allocating additional state sub-structures failed due
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188) * to lack of memory.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) * - -EINTR, -EAGAIN or -ERESTARTSYS, if the IOCTL should be restarted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) * This can either be due to a pending signal, or because the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) * needs to completely bail out to recover from an exceptional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) * situation like a GPU hang. From a userspace point all errors are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) * treated equally.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196) int (*atomic_check)(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) struct drm_atomic_state *state);
^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) * @atomic_commit:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) * This is the only hook to commit an atomic modeset update. The core
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) * guarantees that @atomic_check has been called successfully before
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) * calling this function, and that nothing has been changed in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) * interim.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) * See the documentation for &struct drm_atomic_state for how exactly
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) * an atomic modeset update is described.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) * Drivers using the atomic helpers can implement this hook using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) * drm_atomic_helper_commit(), or one of the exported sub-functions of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) * it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) * Nonblocking commits (as indicated with the nonblock parameter) must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) * do any preparatory work which might result in an unsuccessful commit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) * in the context of this callback. The only exceptions are hardware
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) * errors resulting in -EIO. But even in that case the driver must
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) * ensure that the display pipe is at least running, to avoid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) * compositors crashing when pageflips don't work. Anything else,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) * specifically committing the update to the hardware, should be done
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) * without blocking the caller. For updates which do not require a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) * modeset this must be guaranteed.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) * The driver must wait for any pending rendering to the new
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) * framebuffers to complete before executing the flip. It should also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) * wait for any pending rendering from other drivers if the underlying
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) * buffer is a shared dma-buf. Nonblocking commits must not wait for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) * rendering in the context of this callback.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) * An application can request to be notified when the atomic commit has
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) * completed. These events are per-CRTC and can be distinguished by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) * CRTC index supplied in &drm_event to userspace.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) * The drm core will supply a &struct drm_event in each CRTC's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) * &drm_crtc_state.event. See the documentation for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) * &drm_crtc_state.event for more details about the precise semantics of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) * this event.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) * NOTE:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) * Drivers are not allowed to shut down any display pipe successfully
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242) * enabled through an atomic commit on their own. Doing so can result in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) * compositors crashing if a page flip is suddenly rejected because the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) * pipe is off.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) * 0 on success or one of the below negative error codes:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) * - -EBUSY, if a nonblocking updated is requested and there is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) * an earlier updated pending. Drivers are allowed to support a queue
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) * of outstanding updates, but currently no driver supports that.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) * Note that drivers must wait for preceding updates to complete if a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) * synchronous update is requested, they are not allowed to fail the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255) * commit in that case.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) * - -ENOMEM, if the driver failed to allocate memory. Specifically
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) * this can happen when trying to pin framebuffers, which must only
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259) * be done when committing the state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261) * - -ENOSPC, as a refinement of the more generic -ENOMEM to indicate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) * that the driver has run out of vram, iommu space or similar GPU
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) * address space needed for framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) * - -EIO, if the hardware completely died.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267) * - -EINTR, -EAGAIN or -ERESTARTSYS, if the IOCTL should be restarted.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) * This can either be due to a pending signal, or because the driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) * needs to completely bail out to recover from an exceptional
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) * situation like a GPU hang. From a userspace point of view all errors are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) * treated equally.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) * This list is exhaustive. Specifically this hook is not allowed to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) * return -EINVAL (any invalid requests should be caught in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275) * @atomic_check) or -EDEADLK (this function must not acquire
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) * additional modeset locks).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) int (*atomic_commit)(struct drm_device *dev,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) struct drm_atomic_state *state,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280) bool nonblock);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) * @atomic_state_alloc:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) * This optional hook can be used by drivers that want to subclass struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) * &drm_atomic_state to be able to track their own driver-private global
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) * state easily. If this hook is implemented, drivers must also
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) * implement @atomic_state_clear and @atomic_state_free.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) * Subclassing of &drm_atomic_state is deprecated in favour of using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) * &drm_private_state and &drm_private_obj.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) * A new &drm_atomic_state on success or NULL on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297) struct drm_atomic_state *(*atomic_state_alloc)(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) * @atomic_state_clear:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) * This hook must clear any driver private state duplicated into the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) * passed-in &drm_atomic_state. This hook is called when the caller
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) * encountered a &drm_modeset_lock deadlock and needs to drop all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) * already acquired locks as part of the deadlock avoidance dance
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) * implemented in drm_modeset_backoff().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) * Any duplicated state must be invalidated since a concurrent atomic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) * update might change it, and the drm atomic interfaces always apply
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310) * updates as relative changes to the current state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) * Drivers that implement this must call drm_atomic_state_default_clear()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) * to clear common state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) * Subclassing of &drm_atomic_state is deprecated in favour of using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) * &drm_private_state and &drm_private_obj.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318) void (*atomic_state_clear)(struct drm_atomic_state *state);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) * @atomic_state_free:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) * This hook needs driver private resources and the &drm_atomic_state
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) * itself. Note that the core first calls drm_atomic_state_clear() to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) * avoid code duplicate between the clear and free hooks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) * Drivers that implement this must call
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 328) * drm_atomic_state_default_release() to release common resources.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 329) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 330) * Subclassing of &drm_atomic_state is deprecated in favour of using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 331) * &drm_private_state and &drm_private_obj.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 332) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 333) void (*atomic_state_free)(struct drm_atomic_state *state);
^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) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 337) * struct drm_mode_config - Mode configuration control structure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 338) * @min_width: minimum fb pixel width on this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 339) * @min_height: minimum fb pixel height on this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 340) * @max_width: maximum fb pixel width on this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 341) * @max_height: maximum fb pixel height on this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 342) * @funcs: core driver provided mode setting functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 343) * @fb_base: base address of the framebuffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 344) * @poll_enabled: track polling support for this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 345) * @poll_running: track polling status for this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 346) * @delayed_event: track delayed poll uevent deliver for this device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 347) * @output_poll_work: delayed work for polling in process context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 348) * @preferred_depth: preferred RBG pixel depth, used by fb helpers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 349) * @prefer_shadow: hint to userspace to prefer shadow-fb rendering
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 350) * @cursor_width: hint to userspace for max cursor width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 351) * @cursor_height: hint to userspace for max cursor height
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 352) * @helper_private: mid-layer private data
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 353) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 354) * Core mode resource tracking structure. All CRTC, encoders, and connectors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 355) * enumerated by the driver are added here, as are global properties. Some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 356) * global restrictions are also here, e.g. dimension restrictions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 357) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 358) struct drm_mode_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 359) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 360) * @mutex:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 361) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 362) * This is the big scary modeset BKL which protects everything that
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 363) * isn't protect otherwise. Scope is unclear and fuzzy, try to remove
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 364) * anything from under its protection and move it into more well-scoped
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 365) * locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 366) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 367) * The one important thing this protects is the use of @acquire_ctx.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 368) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 369) struct mutex mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 370)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 371) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 372) * @connection_mutex:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 373) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 374) * This protects connector state and the connector to encoder to CRTC
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 375) * routing chain.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 376) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 377) * For atomic drivers specifically this protects &drm_connector.state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 378) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 379) struct drm_modeset_lock connection_mutex;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 380)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 381) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 382) * @acquire_ctx:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 383) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 384) * Global implicit acquire context used by atomic drivers for legacy
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 385) * IOCTLs. Deprecated, since implicit locking contexts make it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 386) * impossible to use driver-private &struct drm_modeset_lock. Users of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 387) * this must hold @mutex.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 388) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 389) struct drm_modeset_acquire_ctx *acquire_ctx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 390)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 391) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 392) * @idr_mutex:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 393) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 394) * Mutex for KMS ID allocation and management. Protects both @object_idr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 395) * and @tile_idr.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 396) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 397) struct mutex idr_mutex;
^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) * @object_idr:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 401) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 402) * Main KMS ID tracking object. Use this idr for all IDs, fb, crtc,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 403) * connector, modes - just makes life easier to have only one.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 404) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 405) struct idr object_idr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 406)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 407) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 408) * @tile_idr:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 409) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 410) * Use this idr for allocating new IDs for tiled sinks like use in some
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 411) * high-res DP MST screens.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 412) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 413) struct idr tile_idr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 414)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 415) /** @fb_lock: Mutex to protect fb the global @fb_list and @num_fb. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 416) struct mutex fb_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 417) /** @num_fb: Number of entries on @fb_list. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 418) int num_fb;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 419) /** @fb_list: List of all &struct drm_framebuffer. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 420) struct list_head fb_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 421)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 422) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 423) * @connector_list_lock: Protects @num_connector and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 424) * @connector_list and @connector_free_list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 425) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 426) spinlock_t connector_list_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 427) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 428) * @num_connector: Number of connectors on this device. Protected by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 429) * @connector_list_lock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 430) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 431) int num_connector;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 432) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 433) * @connector_ida: ID allocator for connector indices.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 434) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 435) struct ida connector_ida;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 436) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 437) * @connector_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 438) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 439) * List of connector objects linked with &drm_connector.head. Protected
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 440) * by @connector_list_lock. Only use drm_for_each_connector_iter() and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 441) * &struct drm_connector_list_iter to walk this list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 442) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 443) struct list_head connector_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 444) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 445) * @connector_free_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 446) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 447) * List of connector objects linked with &drm_connector.free_head.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 448) * Protected by @connector_list_lock. Used by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 449) * drm_for_each_connector_iter() and
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 450) * &struct drm_connector_list_iter to savely free connectors using
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 451) * @connector_free_work.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 452) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 453) struct llist_head connector_free_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 454) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 455) * @connector_free_work: Work to clean up @connector_free_list.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 456) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 457) struct work_struct connector_free_work;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 458)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 459) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 460) * @num_encoder:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 461) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 462) * Number of encoders on this device. This is invariant over the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 463) * lifetime of a device and hence doesn't need any locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 464) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 465) int num_encoder;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 466) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 467) * @encoder_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 468) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 469) * List of encoder objects linked with &drm_encoder.head. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 470) * invariant over the lifetime of a device and hence doesn't need any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 471) * locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 472) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 473) struct list_head encoder_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 474)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 475) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 476) * @num_total_plane:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 477) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 478) * Number of universal (i.e. with primary/curso) planes on this device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 479) * This is invariant over the lifetime of a device and hence doesn't
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 480) * need any locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 481) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 482) int num_total_plane;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 483) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 484) * @plane_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 485) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 486) * List of plane objects linked with &drm_plane.head. This is invariant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 487) * over the lifetime of a device and hence doesn't need any locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 488) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 489) struct list_head plane_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 490)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 491) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 492) * @num_crtc:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 493) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 494) * Number of CRTCs on this device linked with &drm_crtc.head. This is invariant over the lifetime
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 495) * of a device and hence doesn't need any locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 496) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 497) int num_crtc;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 498) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 499) * @crtc_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 500) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 501) * List of CRTC objects linked with &drm_crtc.head. This is invariant
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 502) * over the lifetime of a device and hence doesn't need any locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 503) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 504) struct list_head crtc_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 505)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 506) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 507) * @property_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 508) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 509) * List of property type objects linked with &drm_property.head. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 510) * invariant over the lifetime of a device and hence doesn't need any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 511) * locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 512) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 513) struct list_head property_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 514)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 515) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 516) * @privobj_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 517) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 518) * List of private objects linked with &drm_private_obj.head. This is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 519) * invariant over the lifetime of a device and hence doesn't need any
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 520) * locks.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 521) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 522) struct list_head privobj_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 523)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 524) int min_width, min_height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 525) int max_width, max_height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 526) const struct drm_mode_config_funcs *funcs;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 527) resource_size_t fb_base;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 528)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 529) /* output poll support */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 530) bool poll_enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 531) bool poll_running;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 532) bool delayed_event;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 533) struct delayed_work output_poll_work;
^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) * @blob_lock:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 537) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 538) * Mutex for blob property allocation and management, protects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 539) * @property_blob_list and &drm_file.blobs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 540) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 541) struct mutex blob_lock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 542)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 543) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 544) * @property_blob_list:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 545) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 546) * List of all the blob property objects linked with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 547) * &drm_property_blob.head. Protected by @blob_lock.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 548) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 549) struct list_head property_blob_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 550)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 551) /* pointers to standard properties */
^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) * @edid_property: Default connector property to hold the EDID of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 555) * currently connected sink, if any.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 556) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 557) struct drm_property *edid_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 558) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 559) * @dpms_property: Default connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 560) * connector's DPMS state.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 561) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 562) struct drm_property *dpms_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 563) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 564) * @path_property: Default connector property to hold the DP MST path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 565) * for the port.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 566) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 567) struct drm_property *path_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 568) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 569) * @tile_property: Default connector property to store the tile
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 570) * position of a tiled screen, for sinks which need to be driven with
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 571) * multiple CRTCs.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 572) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 573) struct drm_property *tile_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 574) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 575) * @link_status_property: Default connector property for link status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 576) * of a connector
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 577) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 578) struct drm_property *link_status_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 579) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 580) * @plane_type_property: Default plane property to differentiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 581) * CURSOR, PRIMARY and OVERLAY legacy uses of planes.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 582) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 583) struct drm_property *plane_type_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 584) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 585) * @prop_src_x: Default atomic plane property for the plane source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 586) * position in the connected &drm_framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 587) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 588) struct drm_property *prop_src_x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 589) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 590) * @prop_src_y: Default atomic plane property for the plane source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 591) * position in the connected &drm_framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 592) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 593) struct drm_property *prop_src_y;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 594) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 595) * @prop_src_w: Default atomic plane property for the plane source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 596) * position in the connected &drm_framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 597) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 598) struct drm_property *prop_src_w;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 599) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 600) * @prop_src_h: Default atomic plane property for the plane source
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 601) * position in the connected &drm_framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 602) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 603) struct drm_property *prop_src_h;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 604) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 605) * @prop_crtc_x: Default atomic plane property for the plane destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 606) * position in the &drm_crtc is being shown on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 607) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 608) struct drm_property *prop_crtc_x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 609) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 610) * @prop_crtc_y: Default atomic plane property for the plane destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 611) * position in the &drm_crtc is being shown on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 612) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 613) struct drm_property *prop_crtc_y;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 614) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 615) * @prop_crtc_w: Default atomic plane property for the plane destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 616) * position in the &drm_crtc is being shown on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 617) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 618) struct drm_property *prop_crtc_w;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 619) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 620) * @prop_crtc_h: Default atomic plane property for the plane destination
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 621) * position in the &drm_crtc is being shown on.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 622) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 623) struct drm_property *prop_crtc_h;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 624) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 625) * @prop_fb_id: Default atomic plane property to specify the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 626) * &drm_framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 627) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 628) struct drm_property *prop_fb_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 629) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 630) * @prop_in_fence_fd: Sync File fd representing the incoming fences
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 631) * for a Plane.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 632) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 633) struct drm_property *prop_in_fence_fd;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 634) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 635) * @prop_out_fence_ptr: Sync File fd pointer representing the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 636) * outgoing fences for a CRTC. Userspace should provide a pointer to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 637) * value of type s32, and then cast that pointer to u64.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 638) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 639) struct drm_property *prop_out_fence_ptr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 640) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 641) * @prop_crtc_id: Default atomic plane property to specify the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 642) * &drm_crtc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 643) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 644) struct drm_property *prop_crtc_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 645) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 646) * @prop_fb_damage_clips: Optional plane property to mark damaged
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 647) * regions on the plane in framebuffer coordinates of the framebuffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 648) * attached to the plane.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 649) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 650) * The layout of blob data is simply an array of &drm_mode_rect. Unlike
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 651) * plane src coordinates, damage clips are not in 16.16 fixed point.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 652) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 653) struct drm_property *prop_fb_damage_clips;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 654) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 655) * @prop_active: Default atomic CRTC property to control the active
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 656) * state, which is the simplified implementation for DPMS in atomic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 657) * drivers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 658) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 659) struct drm_property *prop_active;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 660) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 661) * @prop_mode_id: Default atomic CRTC property to set the mode for a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 662) * CRTC. A 0 mode implies that the CRTC is entirely disabled - all
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 663) * connectors must be of and active must be set to disabled, too.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 664) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 665) struct drm_property *prop_mode_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 666) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 667) * @prop_vrr_enabled: Default atomic CRTC property to indicate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 668) * whether variable refresh rate should be enabled on the CRTC.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 669) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 670) struct drm_property *prop_vrr_enabled;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 671)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 672) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 673) * @dvi_i_subconnector_property: Optional DVI-I property to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 674) * differentiate between analog or digital mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 675) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 676) struct drm_property *dvi_i_subconnector_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 677) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 678) * @dvi_i_select_subconnector_property: Optional DVI-I property to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 679) * select between analog or digital mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 680) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 681) struct drm_property *dvi_i_select_subconnector_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 682)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 683) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 684) * @dp_subconnector_property: Optional DP property to differentiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 685) * between different DP downstream port types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 686) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 687) struct drm_property *dp_subconnector_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 688)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 689) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 690) * @tv_subconnector_property: Optional TV property to differentiate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 691) * between different TV connector types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 692) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 693) struct drm_property *tv_subconnector_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 694) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 695) * @tv_select_subconnector_property: Optional TV property to select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 696) * between different TV connector types.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 697) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 698) struct drm_property *tv_select_subconnector_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 699) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 700) * @tv_mode_property: Optional TV property to select
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 701) * the output TV mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 702) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 703) struct drm_property *tv_mode_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 704) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 705) * @tv_left_margin_property: Optional TV property to set the left
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 706) * margin (expressed in pixels).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 707) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 708) struct drm_property *tv_left_margin_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 709) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 710) * @tv_right_margin_property: Optional TV property to set the right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 711) * margin (expressed in pixels).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 712) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 713) struct drm_property *tv_right_margin_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 714) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 715) * @tv_top_margin_property: Optional TV property to set the right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 716) * margin (expressed in pixels).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 717) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 718) struct drm_property *tv_top_margin_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 719) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 720) * @tv_bottom_margin_property: Optional TV property to set the right
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 721) * margin (expressed in pixels).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 722) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 723) struct drm_property *tv_bottom_margin_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 724) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 725) * @tv_brightness_property: Optional TV property to set the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 726) * brightness.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 727) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 728) struct drm_property *tv_brightness_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 729) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 730) * @tv_contrast_property: Optional TV property to set the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 731) * contrast.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 732) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 733) struct drm_property *tv_contrast_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 734) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 735) * @tv_flicker_reduction_property: Optional TV property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 736) * flicker reduction mode.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 737) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 738) struct drm_property *tv_flicker_reduction_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 739) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 740) * @tv_overscan_property: Optional TV property to control the overscan
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 741) * setting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 742) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 743) struct drm_property *tv_overscan_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 744) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 745) * @tv_saturation_property: Optional TV property to set the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 746) * saturation.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 747) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 748) struct drm_property *tv_saturation_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 749) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 750) * @tv_hue_property: Optional TV property to set the hue.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 751) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 752) struct drm_property *tv_hue_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 753)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 754) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 755) * @scaling_mode_property: Optional connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 756) * upscaling, mostly used for built-in panels.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 757) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 758) struct drm_property *scaling_mode_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 759) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 760) * @aspect_ratio_property: Optional connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 761) * HDMI infoframe aspect ratio setting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 762) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 763) struct drm_property *aspect_ratio_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 764) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 765) * @content_type_property: Optional connector property to control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 766) * HDMI infoframe content type setting.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 767) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 768) struct drm_property *content_type_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 769) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 770) * @degamma_lut_property: Optional CRTC property to set the LUT used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 771) * convert the framebuffer's colors to linear gamma.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 772) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 773) struct drm_property *degamma_lut_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 774) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 775) * @degamma_lut_size_property: Optional CRTC property for the size of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 776) * the degamma LUT as supported by the driver (read-only).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 777) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 778) struct drm_property *degamma_lut_size_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 779) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 780) * @ctm_property: Optional CRTC property to set the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 781) * matrix used to convert colors after the lookup in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 782) * degamma LUT.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 783) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 784) struct drm_property *ctm_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 785) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 786) * @gamma_lut_property: Optional CRTC property to set the LUT used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 787) * convert the colors, after the CTM matrix, to the gamma space of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 788) * connected screen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 789) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 790) struct drm_property *gamma_lut_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 791) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 792) * @gamma_lut_size_property: Optional CRTC property for the size of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 793) * gamma LUT as supported by the driver (read-only).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 794) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 795) struct drm_property *gamma_lut_size_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 796)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 797) #if defined(CONFIG_ROCKCHIP_DRM_CUBIC_LUT)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 798) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 799) * @cubic_lut_property: Optional CRTC property to set the 3D LUT used to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 800) * convert color spaces.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 801) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 802) struct drm_property *cubic_lut_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 803) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 804) * @cubic_lut_size_property: Optional CRTC property for the size of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 805) * 3D LUT as supported by the driver (read-only).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 806) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 807) struct drm_property *cubic_lut_size_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 808) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 809)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 810) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 811) * @suggested_x_property: Optional connector property with a hint for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 812) * the position of the output on the host's screen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 813) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 814) struct drm_property *suggested_x_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 815) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 816) * @suggested_y_property: Optional connector property with a hint for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 817) * the position of the output on the host's screen.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 818) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 819) struct drm_property *suggested_y_property;
^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) * @non_desktop_property: Optional connector property with a hint
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 823) * that device isn't a standard display, and the console/desktop,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 824) * should not be displayed on it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 825) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 826) struct drm_property *non_desktop_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 827)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 828) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 829) * @panel_orientation_property: Optional connector property indicating
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 830) * how the lcd-panel is mounted inside the casing (e.g. normal or
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 831) * upside-down).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 832) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 833) struct drm_property *panel_orientation_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 834)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 835) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 836) * @writeback_fb_id_property: Property for writeback connectors, storing
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 837) * the ID of the output framebuffer.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 838) * See also: drm_writeback_connector_init()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 839) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 840) struct drm_property *writeback_fb_id_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 841)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 842) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 843) * @writeback_pixel_formats_property: Property for writeback connectors,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 844) * storing an array of the supported pixel formats for the writeback
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 845) * engine (read-only).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 846) * See also: drm_writeback_connector_init()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 847) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 848) struct drm_property *writeback_pixel_formats_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 849) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 850) * @writeback_out_fence_ptr_property: Property for writeback connectors,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 851) * fd pointer representing the outgoing fences for a writeback
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 852) * connector. Userspace should provide a pointer to a value of type s32,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 853) * and then cast that pointer to u64.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 854) * See also: drm_writeback_connector_init()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 855) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 856) struct drm_property *writeback_out_fence_ptr_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 857)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 858) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 859) * @hdr_output_metadata_property: Connector property containing hdr
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 860) * metatada. This will be provided by userspace compositors based
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 861) * on HDR content
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 862) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 863) struct drm_property *hdr_output_metadata_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 864)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 865) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 866) * @content_protection_property: DRM ENUM property for content
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 867) * protection. See drm_connector_attach_content_protection_property().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 868) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 869) struct drm_property *content_protection_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 870)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 871) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 872) * @hdcp_content_type_property: DRM ENUM property for type of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 873) * Protected Content.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 874) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 875) struct drm_property *hdcp_content_type_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 876)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 877) /* dumb ioctl parameters */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 878) uint32_t preferred_depth, prefer_shadow;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 879)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 880) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 881) * @prefer_shadow_fbdev:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 882) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 883) * Hint to framebuffer emulation to prefer shadow-fb rendering.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 884) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 885) bool prefer_shadow_fbdev;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 886)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 887) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 888) * @fbdev_use_iomem:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 889) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 890) * Set to true if framebuffer reside in iomem.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 891) * When set to true memcpy_toio() is used when copying the framebuffer in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 892) * drm_fb_helper.drm_fb_helper_dirty_blit_real().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 893) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 894) * FIXME: This should be replaced with a per-mapping is_iomem
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 895) * flag (like ttm does), and then used everywhere in fbdev code.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 896) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 897) bool fbdev_use_iomem;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 898)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 899) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 900) * @quirk_addfb_prefer_xbgr_30bpp:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 901) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 902) * Special hack for legacy ADDFB to keep nouveau userspace happy. Should
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 903) * only ever be set by the nouveau kernel driver.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 904) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 905) bool quirk_addfb_prefer_xbgr_30bpp;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 906)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 907) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 908) * @quirk_addfb_prefer_host_byte_order:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 909) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 910) * When set to true drm_mode_addfb() will pick host byte order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 911) * pixel_format when calling drm_mode_addfb2(). This is how
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 912) * drm_mode_addfb() should have worked from day one. It
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 913) * didn't though, so we ended up with quirks in both kernel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 914) * and userspace drivers to deal with the broken behavior.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 915) * Simply fixing drm_mode_addfb() unconditionally would break
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 916) * these drivers, so add a quirk bit here to allow drivers
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 917) * opt-in.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 918) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 919) bool quirk_addfb_prefer_host_byte_order;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 920)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 921) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 922) * @async_page_flip: Does this device support async flips on the primary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 923) * plane?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 924) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 925) bool async_page_flip;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 926)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 927) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 928) * @allow_fb_modifiers:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 929) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 930) * Whether the driver supports fb modifiers in the ADDFB2.1 ioctl call.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 931) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 932) bool allow_fb_modifiers;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 933)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 934) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 935) * @normalize_zpos:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 936) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 937) * If true the drm core will call drm_atomic_normalize_zpos() as part of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 938) * atomic mode checking from drm_atomic_helper_check()
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 939) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 940) bool normalize_zpos;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 941)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 942) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 943) * @modifiers_property: Plane property to list support modifier/format
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 944) * combination.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 945) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 946) struct drm_property *modifiers_property;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 947)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 948) /* cursor size */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 949) uint32_t cursor_width, cursor_height;
^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) * @suspend_state:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 953) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 954) * Atomic state when suspended.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 955) * Set by drm_mode_config_helper_suspend() and cleared by
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 956) * drm_mode_config_helper_resume().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 957) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 958) struct drm_atomic_state *suspend_state;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 959)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 960) const struct drm_mode_config_helper_funcs *helper_private;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 961) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 962)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 963) int __must_check drmm_mode_config_init(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 964)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 965) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 966) * drm_mode_config_init - DRM mode_configuration structure initialization
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 967) * @dev: DRM device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 968) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 969) * This is the unmanaged version of drmm_mode_config_init() for drivers which
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 970) * still explicitly call drm_mode_config_cleanup().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 971) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 972) * FIXME: This function is deprecated and drivers should be converted over to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 973) * drmm_mode_config_init().
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 974) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 975) static inline int drm_mode_config_init(struct drm_device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 976) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 977) return drmm_mode_config_init(dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 978) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 979)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 980) void drm_mode_config_reset(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 981) void drm_mode_config_cleanup(struct drm_device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 982)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 983) #endif