drm_mode_config.h 28 KB

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