drm_mode_config.h 27 KB

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