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