drm_mode_config.h 23 KB

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