drm_crtc.h (e826d22e16c3230621a937e22f43c403d6e494a7) drm_crtc.h (f98828769c8838f526703ef180b3088a714af2f9)
1/*
2 * Copyright © 2006 Keith Packard
3 * Copyright © 2007-2008 Dave Airlie
4 * Copyright © 2007-2008 Intel Corporation
5 * Jesse Barnes <jesse.barnes@intel.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),

--- 148 unchanged lines hidden (view full) ---

157/* data corresponds to displayid vend/prod/serial */
158struct drm_tile_group {
159 struct kref refcount;
160 struct drm_device *dev;
161 int id;
162 u8 group_data[8];
163};
164
1/*
2 * Copyright © 2006 Keith Packard
3 * Copyright © 2007-2008 Dave Airlie
4 * Copyright © 2007-2008 Intel Corporation
5 * Jesse Barnes <jesse.barnes@intel.com>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),

--- 148 unchanged lines hidden (view full) ---

157/* data corresponds to displayid vend/prod/serial */
158struct drm_tile_group {
159 struct kref refcount;
160 struct drm_device *dev;
161 int id;
162 u8 group_data[8];
163};
164
165/**
166 * struct drm_framebuffer_funcs - framebuffer hooks
167 */
165struct drm_framebuffer_funcs {
168struct drm_framebuffer_funcs {
166 /* note: use drm_framebuffer_remove() */
169 /**
170 * @destroy:
171 *
172 * Clean up framebuffer resources, specifically also unreference the
173 * backing storage. The core guarantees to call this function for every
174 * framebuffer successfully created by ->fb_create() in
175 * &drm_mode_config_funcs.
176 */
167 void (*destroy)(struct drm_framebuffer *framebuffer);
177 void (*destroy)(struct drm_framebuffer *framebuffer);
178
179 /**
180 * @create_handle:
181 *
182 * Create a buffer handle in the driver-specific buffer manager (either
183 * GEM or TTM) valid for the passed-in struct &drm_file. This is used by
184 * the core to implement the GETFB IOCTL, which returns (for
185 * sufficiently priviledged user) also a native buffer handle. This can
186 * be used for seamless transitions between modesetting clients by
187 * copying the current screen contents to a private buffer and blending
188 * between that and the new contents.
189 *
190 * RETURNS:
191 *
192 * 0 on success or a negative error code on failure.
193 */
168 int (*create_handle)(struct drm_framebuffer *fb,
169 struct drm_file *file_priv,
170 unsigned int *handle);
194 int (*create_handle)(struct drm_framebuffer *fb,
195 struct drm_file *file_priv,
196 unsigned int *handle);
171 /*
172 * Optional callback for the dirty fb ioctl.
197 /**
198 * @dirty:
173 *
199 *
174 * Userspace can notify the driver via this callback
175 * that a area of the framebuffer has changed and should
176 * be flushed to the display hardware.
200 * Optional callback for the dirty fb IOCTL.
177 *
201 *
178 * See documentation in drm_mode.h for the struct
179 * drm_mode_fb_dirty_cmd for more information as all
180 * the semantics and arguments have a one to one mapping
181 * on this function.
202 * Userspace can notify the driver via this callback that an area of the
203 * framebuffer has changed and should be flushed to the display
204 * hardware. This can also be used internally, e.g. by the fbdev
205 * emulation, though that's not the case currently.
206 *
207 * See documentation in drm_mode.h for the struct drm_mode_fb_dirty_cmd
208 * for more information as all the semantics and arguments have a one to
209 * one mapping on this function.
210 *
211 * RETURNS:
212 *
213 * 0 on success or a negative error code on failure.
182 */
183 int (*dirty)(struct drm_framebuffer *framebuffer,
184 struct drm_file *file_priv, unsigned flags,
185 unsigned color, struct drm_clip_rect *clips,
186 unsigned num_clips);
187};
188
189struct drm_framebuffer {

--- 59 unchanged lines hidden (view full) ---

249struct drm_crtc;
250struct drm_connector;
251struct drm_encoder;
252struct drm_pending_vblank_event;
253struct drm_plane;
254struct drm_bridge;
255struct drm_atomic_state;
256
214 */
215 int (*dirty)(struct drm_framebuffer *framebuffer,
216 struct drm_file *file_priv, unsigned flags,
217 unsigned color, struct drm_clip_rect *clips,
218 unsigned num_clips);
219};
220
221struct drm_framebuffer {

--- 59 unchanged lines hidden (view full) ---

281struct drm_crtc;
282struct drm_connector;
283struct drm_encoder;
284struct drm_pending_vblank_event;
285struct drm_plane;
286struct drm_bridge;
287struct drm_atomic_state;
288
289struct drm_crtc_helper_funcs;
290struct drm_encoder_helper_funcs;
291struct drm_connector_helper_funcs;
292struct drm_plane_helper_funcs;
293
257/**
258 * struct drm_crtc_state - mutable CRTC state
259 * @crtc: backpointer to the CRTC
260 * @enable: whether the CRTC should be enabled, gates all other state
261 * @active: whether the CRTC is actively displaying (used for DPMS)
262 * @planes_changed: planes on this crtc are updated
263 * @mode_changed: crtc_state->mode or crtc_state->enable has been changed
264 * @active_changed: crtc_state->active has been toggled.

--- 45 unchanged lines hidden (view full) ---

310
311 struct drm_pending_vblank_event *event;
312
313 struct drm_atomic_state *state;
314};
315
316/**
317 * struct drm_crtc_funcs - control CRTCs for a given device
294/**
295 * struct drm_crtc_state - mutable CRTC state
296 * @crtc: backpointer to the CRTC
297 * @enable: whether the CRTC should be enabled, gates all other state
298 * @active: whether the CRTC is actively displaying (used for DPMS)
299 * @planes_changed: planes on this crtc are updated
300 * @mode_changed: crtc_state->mode or crtc_state->enable has been changed
301 * @active_changed: crtc_state->active has been toggled.

--- 45 unchanged lines hidden (view full) ---

347
348 struct drm_pending_vblank_event *event;
349
350 struct drm_atomic_state *state;
351};
352
353/**
354 * struct drm_crtc_funcs - control CRTCs for a given device
318 * @save: save CRTC state
319 * @restore: restore CRTC state
320 * @reset: reset CRTC after state has been invalidated (e.g. resume)
321 * @cursor_set: setup the cursor
322 * @cursor_set2: setup the cursor with hotspot, superseeds @cursor_set if set
323 * @cursor_move: move the cursor
324 * @gamma_set: specify color ramp for CRTC
325 * @destroy: deinit and free object
326 * @set_property: called when a property is changed
327 * @set_config: apply a new CRTC configuration
328 * @page_flip: initiate a page flip
329 * @atomic_duplicate_state: duplicate the atomic state for this CRTC
330 * @atomic_destroy_state: destroy an atomic state for this CRTC
331 * @atomic_set_property: set a property on an atomic state for this CRTC
332 * (do not call directly, use drm_atomic_crtc_set_property())
333 * @atomic_get_property: get a property on an atomic state for this CRTC
334 * (do not call directly, use drm_atomic_crtc_get_property())
335 *
336 * The drm_crtc_funcs structure is the central CRTC management structure
337 * in the DRM. Each CRTC controls one or more connectors (note that the name
338 * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc.
339 * connectors, not just CRTs).
340 *
341 * Each driver is responsible for filling out this structure at startup time,
342 * in addition to providing other modesetting features, like i2c and DDC
343 * bus accessors.
344 */
345struct drm_crtc_funcs {
355 *
356 * The drm_crtc_funcs structure is the central CRTC management structure
357 * in the DRM. Each CRTC controls one or more connectors (note that the name
358 * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc.
359 * connectors, not just CRTs).
360 *
361 * Each driver is responsible for filling out this structure at startup time,
362 * in addition to providing other modesetting features, like i2c and DDC
363 * bus accessors.
364 */
365struct drm_crtc_funcs {
346 /* Save CRTC state */
347 void (*save)(struct drm_crtc *crtc); /* suspend? */
348 /* Restore CRTC state */
349 void (*restore)(struct drm_crtc *crtc); /* resume? */
350 /* Reset CRTC state */
366 /**
367 * @reset:
368 *
369 * Reset CRTC hardware and software state to off. This function isn't
370 * called by the core directly, only through drm_mode_config_reset().
371 * It's not a helper hook only for historical reasons.
372 *
373 * Atomic drivers can use drm_atomic_helper_crtc_reset() to reset
374 * atomic state using this hook.
375 */
351 void (*reset)(struct drm_crtc *crtc);
352
376 void (*reset)(struct drm_crtc *crtc);
377
353 /* cursor controls */
378 /**
379 * @cursor_set:
380 *
381 * Update the cursor image. The cursor position is relative to the CRTC
382 * and can be partially or fully outside of the visible area.
383 *
384 * Note that contrary to all other KMS functions the legacy cursor entry
385 * points don't take a framebuffer object, but instead take directly a
386 * raw buffer object id from the driver's buffer manager (which is
387 * either GEM or TTM for current drivers).
388 *
389 * This entry point is deprecated, drivers should instead implement
390 * universal plane support and register a proper cursor plane using
391 * drm_crtc_init_with_planes().
392 *
393 * This callback is optional
394 *
395 * RETURNS:
396 *
397 * 0 on success or a negative error code on failure.
398 */
354 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv,
355 uint32_t handle, uint32_t width, uint32_t height);
399 int (*cursor_set)(struct drm_crtc *crtc, struct drm_file *file_priv,
400 uint32_t handle, uint32_t width, uint32_t height);
401
402 /**
403 * @cursor_set2:
404 *
405 * Update the cursor image, including hotspot information. The hotspot
406 * must not affect the cursor position in CRTC coordinates, but is only
407 * meant as a hint for virtualized display hardware to coordinate the
408 * guests and hosts cursor position. The cursor hotspot is relative to
409 * the cursor image. Otherwise this works exactly like @cursor_set.
410 *
411 * This entry point is deprecated, drivers should instead implement
412 * universal plane support and register a proper cursor plane using
413 * drm_crtc_init_with_planes().
414 *
415 * This callback is optional.
416 *
417 * RETURNS:
418 *
419 * 0 on success or a negative error code on failure.
420 */
356 int (*cursor_set2)(struct drm_crtc *crtc, struct drm_file *file_priv,
357 uint32_t handle, uint32_t width, uint32_t height,
358 int32_t hot_x, int32_t hot_y);
421 int (*cursor_set2)(struct drm_crtc *crtc, struct drm_file *file_priv,
422 uint32_t handle, uint32_t width, uint32_t height,
423 int32_t hot_x, int32_t hot_y);
424
425 /**
426 * @cursor_move:
427 *
428 * Update the cursor position. The cursor does not need to be visible
429 * when this hook is called.
430 *
431 * This entry point is deprecated, drivers should instead implement
432 * universal plane support and register a proper cursor plane using
433 * drm_crtc_init_with_planes().
434 *
435 * This callback is optional.
436 *
437 * RETURNS:
438 *
439 * 0 on success or a negative error code on failure.
440 */
359 int (*cursor_move)(struct drm_crtc *crtc, int x, int y);
360
441 int (*cursor_move)(struct drm_crtc *crtc, int x, int y);
442
361 /* Set gamma on the CRTC */
443 /**
444 * @gamma_set:
445 *
446 * Set gamma on the CRTC.
447 *
448 * This callback is optional.
449 *
450 * NOTE:
451 *
452 * Drivers that support gamma tables and also fbdev emulation through
453 * the provided helper library need to take care to fill out the gamma
454 * hooks for both. Currently there's a bit an unfortunate duplication
455 * going on, which should eventually be unified to just one set of
456 * hooks.
457 */
362 void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
363 uint32_t start, uint32_t size);
458 void (*gamma_set)(struct drm_crtc *crtc, u16 *r, u16 *g, u16 *b,
459 uint32_t start, uint32_t size);
364 /* Object destroy routine */
460
461 /**
462 * @destroy:
463 *
464 * Clean up plane resources. This is only called at driver unload time
465 * through drm_mode_config_cleanup() since a CRTC cannot be hotplugged
466 * in DRM.
467 */
365 void (*destroy)(struct drm_crtc *crtc);
366
468 void (*destroy)(struct drm_crtc *crtc);
469
470 /**
471 * @set_config:
472 *
473 * This is the main legacy entry point to change the modeset state on a
474 * CRTC. All the details of the desired configuration are passed in a
475 * struct &drm_mode_set - see there for details.
476 *
477 * Drivers implementing atomic modeset should use
478 * drm_atomic_helper_set_config() to implement this hook.
479 *
480 * RETURNS:
481 *
482 * 0 on success or a negative error code on failure.
483 */
367 int (*set_config)(struct drm_mode_set *set);
368
484 int (*set_config)(struct drm_mode_set *set);
485
369 /*
370 * Flip to the given framebuffer. This implements the page
371 * flip ioctl described in drm_mode.h, specifically, the
372 * implementation must return immediately and block all
373 * rendering to the current fb until the flip has completed.
374 * If userspace set the event flag in the ioctl, the event
375 * argument will point to an event to send back when the flip
376 * completes, otherwise it will be NULL.
486 /**
487 * @page_flip:
488 *
489 * Legacy entry point to schedule a flip to the given framebuffer.
490 *
491 * Page flipping is a synchronization mechanism that replaces the frame
492 * buffer being scanned out by the CRTC with a new frame buffer during
493 * vertical blanking, avoiding tearing (except when requested otherwise
494 * through the DRM_MODE_PAGE_FLIP_ASYNC flag). When an application
495 * requests a page flip the DRM core verifies that the new frame buffer
496 * is large enough to be scanned out by the CRTC in the currently
497 * configured mode and then calls the CRTC ->page_flip() operation with a
498 * pointer to the new frame buffer.
499 *
500 * The driver must wait for any pending rendering to the new framebuffer
501 * to complete before executing the flip. It should also wait for any
502 * pending rendering from other drivers if the underlying buffer is a
503 * shared dma-buf.
504 *
505 * An application can request to be notified when the page flip has
506 * completed. The drm core will supply a struct &drm_event in the event
507 * parameter in this case. This can be handled by the
508 * drm_crtc_send_vblank_event() function, which the driver should call on
509 * the provided event upon completion of the flip. Note that if
510 * the driver supports vblank signalling and timestamping the vblank
511 * counters and timestamps must agree with the ones returned from page
512 * flip events. With the current vblank helper infrastructure this can
513 * be achieved by holding a vblank reference while the page flip is
514 * pending, acquired through drm_crtc_vblank_get() and released with
515 * drm_crtc_vblank_put(). Drivers are free to implement their own vblank
516 * counter and timestamp tracking though, e.g. if they have accurate
517 * timestamp registers in hardware.
518 *
519 * FIXME:
520 *
521 * Up to that point drivers need to manage events themselves and can use
522 * even->base.list freely for that. Specifically they need to ensure
523 * that they don't send out page flip (or vblank) events for which the
524 * corresponding drm file has been closed already. The drm core
525 * unfortunately does not (yet) take care of that. Therefore drivers
526 * currently must clean up and release pending events in their
527 * ->preclose driver function.
528 *
529 * This callback is optional.
530 *
531 * NOTE:
532 *
533 * Very early versions of the KMS ABI mandated that the driver must
534 * block (but not reject) any rendering to the old framebuffer until the
535 * flip operation has completed and the old framebuffer is no longer
536 * visible. This requirement has been lifted, and userspace is instead
537 * expected to request delivery of an event and wait with recycling old
538 * buffers until such has been received.
539 *
540 * RETURNS:
541 *
542 * 0 on success or a negative error code on failure. Note that if a
543 * ->page_flip() operation is already pending the callback should return
544 * -EBUSY. Pageflips on a disabled CRTC (either by setting a NULL mode
545 * or just runtime disabled through DPMS respectively the new atomic
546 * "ACTIVE" state) should result in an -EINVAL error code.
377 */
378 int (*page_flip)(struct drm_crtc *crtc,
379 struct drm_framebuffer *fb,
380 struct drm_pending_vblank_event *event,
381 uint32_t flags);
382
547 */
548 int (*page_flip)(struct drm_crtc *crtc,
549 struct drm_framebuffer *fb,
550 struct drm_pending_vblank_event *event,
551 uint32_t flags);
552
553 /**
554 * @set_property:
555 *
556 * This is the legacy entry point to update a property attached to the
557 * CRTC.
558 *
559 * Drivers implementing atomic modeset should use
560 * drm_atomic_helper_crtc_set_property() to implement this hook.
561 *
562 * This callback is optional if the driver does not support any legacy
563 * driver-private properties.
564 *
565 * RETURNS:
566 *
567 * 0 on success or a negative error code on failure.
568 */
383 int (*set_property)(struct drm_crtc *crtc,
384 struct drm_property *property, uint64_t val);
385
569 int (*set_property)(struct drm_crtc *crtc,
570 struct drm_property *property, uint64_t val);
571
386 /* atomic update handling */
572 /**
573 * @atomic_duplicate_state:
574 *
575 * Duplicate the current atomic state for this CRTC and return it.
576 * The core and helpers gurantee that any atomic state duplicated with
577 * this hook and still owned by the caller (i.e. not transferred to the
578 * driver by calling ->atomic_commit() from struct
579 * &drm_mode_config_funcs) will be cleaned up by calling the
580 * @atomic_destroy_state hook in this structure.
581 *
582 * Atomic drivers which don't subclass struct &drm_crtc should use
583 * drm_atomic_helper_crtc_duplicate_state(). Drivers that subclass the
584 * state structure to extend it with driver-private state should use
585 * __drm_atomic_helper_crtc_duplicate_state() to make sure shared state is
586 * duplicated in a consistent fashion across drivers.
587 *
588 * It is an error to call this hook before crtc->state has been
589 * initialized correctly.
590 *
591 * NOTE:
592 *
593 * If the duplicate state references refcounted resources this hook must
594 * acquire a reference for each of them. The driver must release these
595 * references again in @atomic_destroy_state.
596 *
597 * RETURNS:
598 *
599 * Duplicated atomic state or NULL when the allocation failed.
600 */
387 struct drm_crtc_state *(*atomic_duplicate_state)(struct drm_crtc *crtc);
601 struct drm_crtc_state *(*atomic_duplicate_state)(struct drm_crtc *crtc);
602
603 /**
604 * @atomic_destroy_state:
605 *
606 * Destroy a state duplicated with @atomic_duplicate_state and release
607 * or unreference all resources it references
608 */
388 void (*atomic_destroy_state)(struct drm_crtc *crtc,
389 struct drm_crtc_state *state);
609 void (*atomic_destroy_state)(struct drm_crtc *crtc,
610 struct drm_crtc_state *state);
611
612 /**
613 * @atomic_set_property:
614 *
615 * Decode a driver-private property value and store the decoded value
616 * into the passed-in state structure. Since the atomic core decodes all
617 * standardized properties (even for extensions beyond the core set of
618 * properties which might not be implemented by all drivers) this
619 * requires drivers to subclass the state structure.
620 *
621 * Such driver-private properties should really only be implemented for
622 * truly hardware/vendor specific state. Instead it is preferred to
623 * standardize atomic extension and decode the properties used to expose
624 * such an extension in the core.
625 *
626 * Do not call this function directly, use
627 * drm_atomic_crtc_set_property() instead.
628 *
629 * This callback is optional if the driver does not support any
630 * driver-private atomic properties.
631 *
632 * NOTE:
633 *
634 * This function is called in the state assembly phase of atomic
635 * modesets, which can be aborted for any reason (including on
636 * userspace's request to just check whether a configuration would be
637 * possible). Drivers MUST NOT touch any persistent state (hardware or
638 * software) or data structures except the passed in @state parameter.
639 *
640 * Also since userspace controls in which order properties are set this
641 * function must not do any input validation (since the state update is
642 * incomplete and hence likely inconsistent). Instead any such input
643 * validation must be done in the various atomic_check callbacks.
644 *
645 * RETURNS:
646 *
647 * 0 if the property has been found, -EINVAL if the property isn't
648 * implemented by the driver (which should never happen, the core only
649 * asks for properties attached to this CRTC). No other validation is
650 * allowed by the driver. The core already checks that the property
651 * value is within the range (integer, valid enum value, ...) the driver
652 * set when registering the property.
653 */
390 int (*atomic_set_property)(struct drm_crtc *crtc,
391 struct drm_crtc_state *state,
392 struct drm_property *property,
393 uint64_t val);
654 int (*atomic_set_property)(struct drm_crtc *crtc,
655 struct drm_crtc_state *state,
656 struct drm_property *property,
657 uint64_t val);
658 /**
659 * @atomic_get_property:
660 *
661 * Reads out the decoded driver-private property. This is used to
662 * implement the GETCRTC IOCTL.
663 *
664 * Do not call this function directly, use
665 * drm_atomic_crtc_get_property() instead.
666 *
667 * This callback is optional if the driver does not support any
668 * driver-private atomic properties.
669 *
670 * RETURNS:
671 *
672 * 0 on success, -EINVAL if the property isn't implemented by the
673 * driver (which should never happen, the core only asks for
674 * properties attached to this CRTC).
675 */
394 int (*atomic_get_property)(struct drm_crtc *crtc,
395 const struct drm_crtc_state *state,
396 struct drm_property *property,
397 uint64_t *val);
398};
399
400/**
401 * struct drm_crtc - central CRTC control structure

--- 13 unchanged lines hidden (view full) ---

415 * @y: y position on screen
416 * @funcs: CRTC control functions
417 * @gamma_size: size of gamma ramp
418 * @gamma_store: gamma ramp values
419 * @helper_private: mid-layer private data
420 * @properties: property tracking for this CRTC
421 * @state: current atomic state for this CRTC
422 * @acquire_ctx: per-CRTC implicit acquire context used by atomic drivers for
676 int (*atomic_get_property)(struct drm_crtc *crtc,
677 const struct drm_crtc_state *state,
678 struct drm_property *property,
679 uint64_t *val);
680};
681
682/**
683 * struct drm_crtc - central CRTC control structure

--- 13 unchanged lines hidden (view full) ---

697 * @y: y position on screen
698 * @funcs: CRTC control functions
699 * @gamma_size: size of gamma ramp
700 * @gamma_store: gamma ramp values
701 * @helper_private: mid-layer private data
702 * @properties: property tracking for this CRTC
703 * @state: current atomic state for this CRTC
704 * @acquire_ctx: per-CRTC implicit acquire context used by atomic drivers for
423 * legacy ioctls
705 * legacy IOCTLs
424 *
425 * Each CRTC may have one or more connectors associated with it. This structure
426 * allows the CRTC to be controlled.
427 */
428struct drm_crtc {
429 struct drm_device *dev;
430 struct device_node *port;
431 struct list_head head;

--- 30 unchanged lines hidden (view full) ---

462 int x, y;
463 const struct drm_crtc_funcs *funcs;
464
465 /* CRTC gamma size for reporting to userspace */
466 uint32_t gamma_size;
467 uint16_t *gamma_store;
468
469 /* if you are using the helper */
706 *
707 * Each CRTC may have one or more connectors associated with it. This structure
708 * allows the CRTC to be controlled.
709 */
710struct drm_crtc {
711 struct drm_device *dev;
712 struct device_node *port;
713 struct list_head head;

--- 30 unchanged lines hidden (view full) ---

744 int x, y;
745 const struct drm_crtc_funcs *funcs;
746
747 /* CRTC gamma size for reporting to userspace */
748 uint32_t gamma_size;
749 uint16_t *gamma_store;
750
751 /* if you are using the helper */
470 const void *helper_private;
752 const struct drm_crtc_helper_funcs *helper_private;
471
472 struct drm_object_properties properties;
473
474 struct drm_crtc_state *state;
475
476 /*
753
754 struct drm_object_properties properties;
755
756 struct drm_crtc_state *state;
757
758 /*
477 * For legacy crtc ioctls so that atomic drivers can get at the locking
759 * For legacy crtc IOCTLs so that atomic drivers can get at the locking
478 * acquire context.
479 */
480 struct drm_modeset_acquire_ctx *acquire_ctx;
481};
482
483/**
484 * struct drm_connector_state - mutable connector state
485 * @connector: backpointer to the connector

--- 8 unchanged lines hidden (view full) ---

494
495 struct drm_encoder *best_encoder;
496
497 struct drm_atomic_state *state;
498};
499
500/**
501 * struct drm_connector_funcs - control connectors on a given device
760 * acquire context.
761 */
762 struct drm_modeset_acquire_ctx *acquire_ctx;
763};
764
765/**
766 * struct drm_connector_state - mutable connector state
767 * @connector: backpointer to the connector

--- 8 unchanged lines hidden (view full) ---

776
777 struct drm_encoder *best_encoder;
778
779 struct drm_atomic_state *state;
780};
781
782/**
783 * struct drm_connector_funcs - control connectors on a given device
502 * @dpms: set power state
503 * @save: save connector state
504 * @restore: restore connector state
505 * @reset: reset connector after state has been invalidated (e.g. resume)
506 * @detect: is this connector active?
507 * @fill_modes: fill mode list for this connector
508 * @set_property: property for this connector may need an update
509 * @destroy: make object go away
510 * @force: notify the driver that the connector is forced on
511 * @atomic_duplicate_state: duplicate the atomic state for this connector
512 * @atomic_destroy_state: destroy an atomic state for this connector
513 * @atomic_set_property: set a property on an atomic state for this connector
514 * (do not call directly, use drm_atomic_connector_set_property())
515 * @atomic_get_property: get a property on an atomic state for this connector
516 * (do not call directly, use drm_atomic_connector_get_property())
517 *
518 * Each CRTC may have one or more connectors attached to it. The functions
519 * below allow the core DRM code to control connectors, enumerate available modes,
520 * etc.
521 */
522struct drm_connector_funcs {
784 *
785 * Each CRTC may have one or more connectors attached to it. The functions
786 * below allow the core DRM code to control connectors, enumerate available modes,
787 * etc.
788 */
789struct drm_connector_funcs {
790 /**
791 * @dpms:
792 *
793 * Legacy entry point to set the per-connector DPMS state. Legacy DPMS
794 * is exposed as a standard property on the connector, but diverted to
795 * this callback in the drm core. Note that atomic drivers don't
796 * implement the 4 level DPMS support on the connector any more, but
797 * instead only have an on/off "ACTIVE" property on the CRTC object.
798 *
799 * Drivers implementing atomic modeset should use
800 * drm_atomic_helper_connector_dpms() to implement this hook.
801 *
802 * RETURNS:
803 *
804 * 0 on success or a negative error code on failure.
805 */
523 int (*dpms)(struct drm_connector *connector, int mode);
806 int (*dpms)(struct drm_connector *connector, int mode);
524 void (*save)(struct drm_connector *connector);
525 void (*restore)(struct drm_connector *connector);
807
808 /**
809 * @reset:
810 *
811 * Reset connector hardware and software state to off. This function isn't
812 * called by the core directly, only through drm_mode_config_reset().
813 * It's not a helper hook only for historical reasons.
814 *
815 * Atomic drivers can use drm_atomic_helper_connector_reset() to reset
816 * atomic state using this hook.
817 */
526 void (*reset)(struct drm_connector *connector);
527
818 void (*reset)(struct drm_connector *connector);
819
528 /* Check to see if anything is attached to the connector.
529 * @force is set to false whilst polling, true when checking the
530 * connector due to user request. @force can be used by the driver
531 * to avoid expensive, destructive operations during automated
532 * probing.
820 /**
821 * @detect:
822 *
823 * Check to see if anything is attached to the connector. The parameter
824 * force is set to false whilst polling, true when checking the
825 * connector due to a user request. force can be used by the driver to
826 * avoid expensive, destructive operations during automated probing.
827 *
828 * FIXME:
829 *
830 * Note that this hook is only called by the probe helper. It's not in
831 * the helper library vtable purely for historical reasons. The only DRM
832 * core entry point to probe connector state is @fill_modes.
833 *
834 * RETURNS:
835 *
836 * drm_connector_status indicating the connector's status.
533 */
534 enum drm_connector_status (*detect)(struct drm_connector *connector,
535 bool force);
837 */
838 enum drm_connector_status (*detect)(struct drm_connector *connector,
839 bool force);
840
841 /**
842 * @force:
843 *
844 * This function is called to update internal encoder state when the
845 * connector is forced to a certain state by userspace, either through
846 * the sysfs interfaces or on the kernel cmdline. In that case the
847 * @detect callback isn't called.
848 *
849 * FIXME:
850 *
851 * Note that this hook is only called by the probe helper. It's not in
852 * the helper library vtable purely for historical reasons. The only DRM
853 * core entry point to probe connector state is @fill_modes.
854 */
855 void (*force)(struct drm_connector *connector);
856
857 /**
858 * @fill_modes:
859 *
860 * Entry point for output detection and basic mode validation. The
861 * driver should reprobe the output if needed (e.g. when hotplug
862 * handling is unreliable), add all detected modes to connector->modes
863 * and filter out any the device can't support in any configuration. It
864 * also needs to filter out any modes wider or higher than the
865 * parameters max_width and max_height indicate.
866 *
867 * The drivers must also prune any modes no longer valid from
868 * connector->modes. Furthermore it must update connector->status and
869 * connector->edid. If no EDID has been received for this output
870 * connector->edid must be NULL.
871 *
872 * Drivers using the probe helpers should use
873 * drm_helper_probe_single_connector_modes() or
874 * drm_helper_probe_single_connector_modes_nomerge() to implement this
875 * function.
876 *
877 * RETURNS:
878 *
879 * The number of modes detected and filled into connector->modes.
880 */
536 int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
881 int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
882
883 /**
884 * @set_property:
885 *
886 * This is the legacy entry point to update a property attached to the
887 * connector.
888 *
889 * Drivers implementing atomic modeset should use
890 * drm_atomic_helper_connector_set_property() to implement this hook.
891 *
892 * This callback is optional if the driver does not support any legacy
893 * driver-private properties.
894 *
895 * RETURNS:
896 *
897 * 0 on success or a negative error code on failure.
898 */
537 int (*set_property)(struct drm_connector *connector, struct drm_property *property,
538 uint64_t val);
899 int (*set_property)(struct drm_connector *connector, struct drm_property *property,
900 uint64_t val);
901
902 /**
903 * @destroy:
904 *
905 * Clean up connector resources. This is called at driver unload time
906 * through drm_mode_config_cleanup(). It can also be called at runtime
907 * when a connector is being hot-unplugged for drivers that support
908 * connector hotplugging (e.g. DisplayPort MST).
909 */
539 void (*destroy)(struct drm_connector *connector);
910 void (*destroy)(struct drm_connector *connector);
540 void (*force)(struct drm_connector *connector);
541
911
542 /* atomic update handling */
912 /**
913 * @atomic_duplicate_state:
914 *
915 * Duplicate the current atomic state for this connector and return it.
916 * The core and helpers gurantee that any atomic state duplicated with
917 * this hook and still owned by the caller (i.e. not transferred to the
918 * driver by calling ->atomic_commit() from struct
919 * &drm_mode_config_funcs) will be cleaned up by calling the
920 * @atomic_destroy_state hook in this structure.
921 *
922 * Atomic drivers which don't subclass struct &drm_connector_state should use
923 * drm_atomic_helper_connector_duplicate_state(). Drivers that subclass the
924 * state structure to extend it with driver-private state should use
925 * __drm_atomic_helper_connector_duplicate_state() to make sure shared state is
926 * duplicated in a consistent fashion across drivers.
927 *
928 * It is an error to call this hook before connector->state has been
929 * initialized correctly.
930 *
931 * NOTE:
932 *
933 * If the duplicate state references refcounted resources this hook must
934 * acquire a reference for each of them. The driver must release these
935 * references again in @atomic_destroy_state.
936 *
937 * RETURNS:
938 *
939 * Duplicated atomic state or NULL when the allocation failed.
940 */
543 struct drm_connector_state *(*atomic_duplicate_state)(struct drm_connector *connector);
941 struct drm_connector_state *(*atomic_duplicate_state)(struct drm_connector *connector);
942
943 /**
944 * @atomic_destroy_state:
945 *
946 * Destroy a state duplicated with @atomic_duplicate_state and release
947 * or unreference all resources it references
948 */
544 void (*atomic_destroy_state)(struct drm_connector *connector,
545 struct drm_connector_state *state);
949 void (*atomic_destroy_state)(struct drm_connector *connector,
950 struct drm_connector_state *state);
951
952 /**
953 * @atomic_set_property:
954 *
955 * Decode a driver-private property value and store the decoded value
956 * into the passed-in state structure. Since the atomic core decodes all
957 * standardized properties (even for extensions beyond the core set of
958 * properties which might not be implemented by all drivers) this
959 * requires drivers to subclass the state structure.
960 *
961 * Such driver-private properties should really only be implemented for
962 * truly hardware/vendor specific state. Instead it is preferred to
963 * standardize atomic extension and decode the properties used to expose
964 * such an extension in the core.
965 *
966 * Do not call this function directly, use
967 * drm_atomic_connector_set_property() instead.
968 *
969 * This callback is optional if the driver does not support any
970 * driver-private atomic properties.
971 *
972 * NOTE:
973 *
974 * This function is called in the state assembly phase of atomic
975 * modesets, which can be aborted for any reason (including on
976 * userspace's request to just check whether a configuration would be
977 * possible). Drivers MUST NOT touch any persistent state (hardware or
978 * software) or data structures except the passed in @state parameter.
979 *
980 * Also since userspace controls in which order properties are set this
981 * function must not do any input validation (since the state update is
982 * incomplete and hence likely inconsistent). Instead any such input
983 * validation must be done in the various atomic_check callbacks.
984 *
985 * RETURNS:
986 *
987 * 0 if the property has been found, -EINVAL if the property isn't
988 * implemented by the driver (which shouldn't ever happen, the core only
989 * asks for properties attached to this connector). No other validation
990 * is allowed by the driver. The core already checks that the property
991 * value is within the range (integer, valid enum value, ...) the driver
992 * set when registering the property.
993 */
546 int (*atomic_set_property)(struct drm_connector *connector,
547 struct drm_connector_state *state,
548 struct drm_property *property,
549 uint64_t val);
994 int (*atomic_set_property)(struct drm_connector *connector,
995 struct drm_connector_state *state,
996 struct drm_property *property,
997 uint64_t val);
998
999 /**
1000 * @atomic_get_property:
1001 *
1002 * Reads out the decoded driver-private property. This is used to
1003 * implement the GETCONNECTOR IOCTL.
1004 *
1005 * Do not call this function directly, use
1006 * drm_atomic_connector_get_property() instead.
1007 *
1008 * This callback is optional if the driver does not support any
1009 * driver-private atomic properties.
1010 *
1011 * RETURNS:
1012 *
1013 * 0 on success, -EINVAL if the property isn't implemented by the
1014 * driver (which shouldn't ever happen, the core only asks for
1015 * properties attached to this connector).
1016 */
550 int (*atomic_get_property)(struct drm_connector *connector,
551 const struct drm_connector_state *state,
552 struct drm_property *property,
553 uint64_t *val);
554};
555
556/**
557 * struct drm_encoder_funcs - encoder controls
1017 int (*atomic_get_property)(struct drm_connector *connector,
1018 const struct drm_connector_state *state,
1019 struct drm_property *property,
1020 uint64_t *val);
1021};
1022
1023/**
1024 * struct drm_encoder_funcs - encoder controls
558 * @reset: reset state (e.g. at init or resume time)
559 * @destroy: cleanup and free associated data
560 *
561 * Encoders sit between CRTCs and connectors.
562 */
563struct drm_encoder_funcs {
1025 *
1026 * Encoders sit between CRTCs and connectors.
1027 */
1028struct drm_encoder_funcs {
1029 /**
1030 * @reset:
1031 *
1032 * Reset encoder hardware and software state to off. This function isn't
1033 * called by the core directly, only through drm_mode_config_reset().
1034 * It's not a helper hook only for historical reasons.
1035 */
564 void (*reset)(struct drm_encoder *encoder);
1036 void (*reset)(struct drm_encoder *encoder);
1037
1038 /**
1039 * @destroy:
1040 *
1041 * Clean up encoder resources. This is only called at driver unload time
1042 * through drm_mode_config_cleanup() since an encoder cannot be
1043 * hotplugged in DRM.
1044 */
565 void (*destroy)(struct drm_encoder *encoder);
566};
567
568#define DRM_CONNECTOR_MAX_ENCODER 3
569
570/**
571 * struct drm_encoder - central DRM encoder structure
572 * @dev: parent DRM device

--- 19 unchanged lines hidden (view full) ---

592 char *name;
593 int encoder_type;
594 uint32_t possible_crtcs;
595 uint32_t possible_clones;
596
597 struct drm_crtc *crtc;
598 struct drm_bridge *bridge;
599 const struct drm_encoder_funcs *funcs;
1045 void (*destroy)(struct drm_encoder *encoder);
1046};
1047
1048#define DRM_CONNECTOR_MAX_ENCODER 3
1049
1050/**
1051 * struct drm_encoder - central DRM encoder structure
1052 * @dev: parent DRM device

--- 19 unchanged lines hidden (view full) ---

1072 char *name;
1073 int encoder_type;
1074 uint32_t possible_crtcs;
1075 uint32_t possible_clones;
1076
1077 struct drm_crtc *crtc;
1078 struct drm_bridge *bridge;
1079 const struct drm_encoder_funcs *funcs;
600 const void *helper_private;
1080 const struct drm_encoder_helper_funcs *helper_private;
601};
602
603/* should we poll this connector for connects and disconnects */
604/* hot plug detectable */
605#define DRM_CONNECTOR_POLL_HPD (1 << 0)
606/* poll for connections */
607#define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
608/* can cleanly poll for disconnections without flickering the screen */

--- 88 unchanged lines hidden (view full) ---

697
698 struct drm_property_blob *tile_blob_ptr;
699
700 uint8_t polled; /* DRM_CONNECTOR_POLL_* */
701
702 /* requested DPMS state */
703 int dpms;
704
1081};
1082
1083/* should we poll this connector for connects and disconnects */
1084/* hot plug detectable */
1085#define DRM_CONNECTOR_POLL_HPD (1 << 0)
1086/* poll for connections */
1087#define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
1088/* can cleanly poll for disconnections without flickering the screen */

--- 88 unchanged lines hidden (view full) ---

1177
1178 struct drm_property_blob *tile_blob_ptr;
1179
1180 uint8_t polled; /* DRM_CONNECTOR_POLL_* */
1181
1182 /* requested DPMS state */
1183 int dpms;
1184
705 const void *helper_private;
1185 const struct drm_connector_helper_funcs *helper_private;
706
707 /* forced on connector */
708 struct drm_cmdline_mode cmdline_mode;
709 enum drm_connector_force force;
710 bool override_edid;
711 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
712 struct drm_encoder *encoder; /* currently active encoder */
713

--- 63 unchanged lines hidden (view full) ---

777 unsigned int rotation;
778
779 struct drm_atomic_state *state;
780};
781
782
783/**
784 * struct drm_plane_funcs - driver plane control functions
1186
1187 /* forced on connector */
1188 struct drm_cmdline_mode cmdline_mode;
1189 enum drm_connector_force force;
1190 bool override_edid;
1191 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
1192 struct drm_encoder *encoder; /* currently active encoder */
1193

--- 63 unchanged lines hidden (view full) ---

1257 unsigned int rotation;
1258
1259 struct drm_atomic_state *state;
1260};
1261
1262
1263/**
1264 * struct drm_plane_funcs - driver plane control functions
785 * @update_plane: update the plane configuration
786 * @disable_plane: shut down the plane
787 * @destroy: clean up plane resources
788 * @reset: reset plane after state has been invalidated (e.g. resume)
789 * @set_property: called when a property is changed
790 * @atomic_duplicate_state: duplicate the atomic state for this plane
791 * @atomic_destroy_state: destroy an atomic state for this plane
792 * @atomic_set_property: set a property on an atomic state for this plane
793 * (do not call directly, use drm_atomic_plane_set_property())
794 * @atomic_get_property: get a property on an atomic state for this plane
795 * (do not call directly, use drm_atomic_plane_get_property())
796 */
797struct drm_plane_funcs {
1265 */
1266struct drm_plane_funcs {
1267 /**
1268 * @update_plane:
1269 *
1270 * This is the legacy entry point to enable and configure the plane for
1271 * the given CRTC and framebuffer. It is never called to disable the
1272 * plane, i.e. the passed-in crtc and fb paramters are never NULL.
1273 *
1274 * The source rectangle in frame buffer memory coordinates is given by
1275 * the src_x, src_y, src_w and src_h parameters (as 16.16 fixed point
1276 * values). Devices that don't support subpixel plane coordinates can
1277 * ignore the fractional part.
1278 *
1279 * The destination rectangle in CRTC coordinates is given by the
1280 * crtc_x, crtc_y, crtc_w and crtc_h parameters (as integer values).
1281 * Devices scale the source rectangle to the destination rectangle. If
1282 * scaling is not supported, and the source rectangle size doesn't match
1283 * the destination rectangle size, the driver must return a
1284 * -<errorname>EINVAL</errorname> error.
1285 *
1286 * Drivers implementing atomic modeset should use
1287 * drm_atomic_helper_update_plane() to implement this hook.
1288 *
1289 * RETURNS:
1290 *
1291 * 0 on success or a negative error code on failure.
1292 */
798 int (*update_plane)(struct drm_plane *plane,
799 struct drm_crtc *crtc, struct drm_framebuffer *fb,
800 int crtc_x, int crtc_y,
801 unsigned int crtc_w, unsigned int crtc_h,
802 uint32_t src_x, uint32_t src_y,
803 uint32_t src_w, uint32_t src_h);
1293 int (*update_plane)(struct drm_plane *plane,
1294 struct drm_crtc *crtc, struct drm_framebuffer *fb,
1295 int crtc_x, int crtc_y,
1296 unsigned int crtc_w, unsigned int crtc_h,
1297 uint32_t src_x, uint32_t src_y,
1298 uint32_t src_w, uint32_t src_h);
1299
1300 /**
1301 * @disable_plane:
1302 *
1303 * This is the legacy entry point to disable the plane. The DRM core
1304 * calls this method in response to a DRM_IOCTL_MODE_SETPLANE IOCTL call
1305 * with the frame buffer ID set to 0. Disabled planes must not be
1306 * processed by the CRTC.
1307 *
1308 * Drivers implementing atomic modeset should use
1309 * drm_atomic_helper_disable_plane() to implement this hook.
1310 *
1311 * RETURNS:
1312 *
1313 * 0 on success or a negative error code on failure.
1314 */
804 int (*disable_plane)(struct drm_plane *plane);
1315 int (*disable_plane)(struct drm_plane *plane);
1316
1317 /**
1318 * @destroy:
1319 *
1320 * Clean up plane resources. This is only called at driver unload time
1321 * through drm_mode_config_cleanup() since a plane cannot be hotplugged
1322 * in DRM.
1323 */
805 void (*destroy)(struct drm_plane *plane);
1324 void (*destroy)(struct drm_plane *plane);
1325
1326 /**
1327 * @reset:
1328 *
1329 * Reset plane hardware and software state to off. This function isn't
1330 * called by the core directly, only through drm_mode_config_reset().
1331 * It's not a helper hook only for historical reasons.
1332 *
1333 * Atomic drivers can use drm_atomic_helper_plane_reset() to reset
1334 * atomic state using this hook.
1335 */
806 void (*reset)(struct drm_plane *plane);
807
1336 void (*reset)(struct drm_plane *plane);
1337
1338 /**
1339 * @set_property:
1340 *
1341 * This is the legacy entry point to update a property attached to the
1342 * plane.
1343 *
1344 * Drivers implementing atomic modeset should use
1345 * drm_atomic_helper_plane_set_property() to implement this hook.
1346 *
1347 * This callback is optional if the driver does not support any legacy
1348 * driver-private properties.
1349 *
1350 * RETURNS:
1351 *
1352 * 0 on success or a negative error code on failure.
1353 */
808 int (*set_property)(struct drm_plane *plane,
809 struct drm_property *property, uint64_t val);
810
1354 int (*set_property)(struct drm_plane *plane,
1355 struct drm_property *property, uint64_t val);
1356
811 /* atomic update handling */
1357 /**
1358 * @atomic_duplicate_state:
1359 *
1360 * Duplicate the current atomic state for this plane and return it.
1361 * The core and helpers gurantee that any atomic state duplicated with
1362 * this hook and still owned by the caller (i.e. not transferred to the
1363 * driver by calling ->atomic_commit() from struct
1364 * &drm_mode_config_funcs) will be cleaned up by calling the
1365 * @atomic_destroy_state hook in this structure.
1366 *
1367 * Atomic drivers which don't subclass struct &drm_plane_state should use
1368 * drm_atomic_helper_plane_duplicate_state(). Drivers that subclass the
1369 * state structure to extend it with driver-private state should use
1370 * __drm_atomic_helper_plane_duplicate_state() to make sure shared state is
1371 * duplicated in a consistent fashion across drivers.
1372 *
1373 * It is an error to call this hook before plane->state has been
1374 * initialized correctly.
1375 *
1376 * NOTE:
1377 *
1378 * If the duplicate state references refcounted resources this hook must
1379 * acquire a reference for each of them. The driver must release these
1380 * references again in @atomic_destroy_state.
1381 *
1382 * RETURNS:
1383 *
1384 * Duplicated atomic state or NULL when the allocation failed.
1385 */
812 struct drm_plane_state *(*atomic_duplicate_state)(struct drm_plane *plane);
1386 struct drm_plane_state *(*atomic_duplicate_state)(struct drm_plane *plane);
1387
1388 /**
1389 * @atomic_destroy_state:
1390 *
1391 * Destroy a state duplicated with @atomic_duplicate_state and release
1392 * or unreference all resources it references
1393 */
813 void (*atomic_destroy_state)(struct drm_plane *plane,
814 struct drm_plane_state *state);
1394 void (*atomic_destroy_state)(struct drm_plane *plane,
1395 struct drm_plane_state *state);
1396
1397 /**
1398 * @atomic_set_property:
1399 *
1400 * Decode a driver-private property value and store the decoded value
1401 * into the passed-in state structure. Since the atomic core decodes all
1402 * standardized properties (even for extensions beyond the core set of
1403 * properties which might not be implemented by all drivers) this
1404 * requires drivers to subclass the state structure.
1405 *
1406 * Such driver-private properties should really only be implemented for
1407 * truly hardware/vendor specific state. Instead it is preferred to
1408 * standardize atomic extension and decode the properties used to expose
1409 * such an extension in the core.
1410 *
1411 * Do not call this function directly, use
1412 * drm_atomic_plane_set_property() instead.
1413 *
1414 * This callback is optional if the driver does not support any
1415 * driver-private atomic properties.
1416 *
1417 * NOTE:
1418 *
1419 * This function is called in the state assembly phase of atomic
1420 * modesets, which can be aborted for any reason (including on
1421 * userspace's request to just check whether a configuration would be
1422 * possible). Drivers MUST NOT touch any persistent state (hardware or
1423 * software) or data structures except the passed in @state parameter.
1424 *
1425 * Also since userspace controls in which order properties are set this
1426 * function must not do any input validation (since the state update is
1427 * incomplete and hence likely inconsistent). Instead any such input
1428 * validation must be done in the various atomic_check callbacks.
1429 *
1430 * RETURNS:
1431 *
1432 * 0 if the property has been found, -EINVAL if the property isn't
1433 * implemented by the driver (which shouldn't ever happen, the core only
1434 * asks for properties attached to this plane). No other validation is
1435 * allowed by the driver. The core already checks that the property
1436 * value is within the range (integer, valid enum value, ...) the driver
1437 * set when registering the property.
1438 */
815 int (*atomic_set_property)(struct drm_plane *plane,
816 struct drm_plane_state *state,
817 struct drm_property *property,
818 uint64_t val);
1439 int (*atomic_set_property)(struct drm_plane *plane,
1440 struct drm_plane_state *state,
1441 struct drm_property *property,
1442 uint64_t val);
1443
1444 /**
1445 * @atomic_get_property:
1446 *
1447 * Reads out the decoded driver-private property. This is used to
1448 * implement the GETPLANE IOCTL.
1449 *
1450 * Do not call this function directly, use
1451 * drm_atomic_plane_get_property() instead.
1452 *
1453 * This callback is optional if the driver does not support any
1454 * driver-private atomic properties.
1455 *
1456 * RETURNS:
1457 *
1458 * 0 on success, -EINVAL if the property isn't implemented by the
1459 * driver (which should never happen, the core only asks for
1460 * properties attached to this plane).
1461 */
819 int (*atomic_get_property)(struct drm_plane *plane,
820 const struct drm_plane_state *state,
821 struct drm_property *property,
822 uint64_t *val);
823};
824
825enum drm_plane_type {
826 DRM_PLANE_TYPE_OVERLAY,
827 DRM_PLANE_TYPE_PRIMARY,
828 DRM_PLANE_TYPE_CURSOR,
829};
830
1462 int (*atomic_get_property)(struct drm_plane *plane,
1463 const struct drm_plane_state *state,
1464 struct drm_property *property,
1465 uint64_t *val);
1466};
1467
1468enum drm_plane_type {
1469 DRM_PLANE_TYPE_OVERLAY,
1470 DRM_PLANE_TYPE_PRIMARY,
1471 DRM_PLANE_TYPE_CURSOR,
1472};
1473
1474
831/**
832 * struct drm_plane - central DRM plane control structure
833 * @dev: DRM device this plane belongs to
834 * @head: for list management
835 * @base: base mode object
836 * @possible_crtcs: pipes this plane can be bound to
837 * @format_types: array of formats supported by this plane
838 * @format_count: number of formats supported

--- 26 unchanged lines hidden (view full) ---

865 struct drm_framebuffer *old_fb;
866
867 const struct drm_plane_funcs *funcs;
868
869 struct drm_object_properties properties;
870
871 enum drm_plane_type type;
872
1475/**
1476 * struct drm_plane - central DRM plane control structure
1477 * @dev: DRM device this plane belongs to
1478 * @head: for list management
1479 * @base: base mode object
1480 * @possible_crtcs: pipes this plane can be bound to
1481 * @format_types: array of formats supported by this plane
1482 * @format_count: number of formats supported

--- 26 unchanged lines hidden (view full) ---

1509 struct drm_framebuffer *old_fb;
1510
1511 const struct drm_plane_funcs *funcs;
1512
1513 struct drm_object_properties properties;
1514
1515 enum drm_plane_type type;
1516
873 const void *helper_private;
1517 const struct drm_plane_helper_funcs *helper_private;
874
875 struct drm_plane_state *state;
876};
877
878/**
879 * struct drm_bridge_funcs - drm_bridge control functions
880 * @attach: Called during drm_bridge_attach
1518
1519 struct drm_plane_state *state;
1520};
1521
1522/**
1523 * struct drm_bridge_funcs - drm_bridge control functions
1524 * @attach: Called during drm_bridge_attach
881 * @mode_fixup: Try to fixup (or reject entirely) proposed mode for this bridge
882 * @disable: Called right before encoder prepare, disables the bridge
883 * @post_disable: Called right after encoder prepare, for lockstepped disable
884 * @mode_set: Set this mode to the bridge
885 * @pre_enable: Called right before encoder commit, for lockstepped commit
886 * @enable: Called right after encoder commit, enables the bridge
887 */
888struct drm_bridge_funcs {
889 int (*attach)(struct drm_bridge *bridge);
1525 */
1526struct drm_bridge_funcs {
1527 int (*attach)(struct drm_bridge *bridge);
1528
1529 /**
1530 * @mode_fixup:
1531 *
1532 * This callback is used to validate and adjust a mode. The paramater
1533 * mode is the display mode that should be fed to the next element in
1534 * the display chain, either the final &drm_connector or the next
1535 * &drm_bridge. The parameter adjusted_mode is the input mode the bridge
1536 * requires. It can be modified by this callback and does not need to
1537 * match mode.
1538 *
1539 * This is the only hook that allows a bridge to reject a modeset. If
1540 * this function passes all other callbacks must succeed for this
1541 * configuration.
1542 *
1543 * NOTE:
1544 *
1545 * This function is called in the check phase of atomic modesets, which
1546 * can be aborted for any reason (including on userspace's request to
1547 * just check whether a configuration would be possible). Drivers MUST
1548 * NOT touch any persistent state (hardware or software) or data
1549 * structures except the passed in @state parameter.
1550 *
1551 * RETURNS:
1552 *
1553 * True if an acceptable configuration is possible, false if the modeset
1554 * operation should be rejected.
1555 */
890 bool (*mode_fixup)(struct drm_bridge *bridge,
891 const struct drm_display_mode *mode,
892 struct drm_display_mode *adjusted_mode);
1556 bool (*mode_fixup)(struct drm_bridge *bridge,
1557 const struct drm_display_mode *mode,
1558 struct drm_display_mode *adjusted_mode);
1559 /**
1560 * @disable:
1561 *
1562 * This callback should disable the bridge. It is called right before
1563 * the preceding element in the display pipe is disabled. If the
1564 * preceding element is a bridge this means it's called before that
1565 * bridge's ->disable() function. If the preceding element is a
1566 * &drm_encoder it's called right before the encoder's ->disable(),
1567 * ->prepare() or ->dpms() hook from struct &drm_encoder_helper_funcs.
1568 *
1569 * The bridge can assume that the display pipe (i.e. clocks and timing
1570 * signals) feeding it is still running when this callback is called.
1571 */
893 void (*disable)(struct drm_bridge *bridge);
1572 void (*disable)(struct drm_bridge *bridge);
1573
1574 /**
1575 * @post_disable:
1576 *
1577 * This callback should disable the bridge. It is called right after
1578 * the preceding element in the display pipe is disabled. If the
1579 * preceding element is a bridge this means it's called after that
1580 * bridge's ->post_disable() function. If the preceding element is a
1581 * &drm_encoder it's called right after the encoder's ->disable(),
1582 * ->prepare() or ->dpms() hook from struct &drm_encoder_helper_funcs.
1583 *
1584 * The bridge must assume that the display pipe (i.e. clocks and timing
1585 * singals) feeding it is no longer running when this callback is
1586 * called.
1587 */
894 void (*post_disable)(struct drm_bridge *bridge);
1588 void (*post_disable)(struct drm_bridge *bridge);
1589
1590 /**
1591 * @mode_set:
1592 *
1593 * This callback should set the given mode on the bridge. It is called
1594 * after the ->mode_set() callback for the preceding element in the
1595 * display pipeline has been called already. The display pipe (i.e.
1596 * clocks and timing signals) is off when this function is called.
1597 */
895 void (*mode_set)(struct drm_bridge *bridge,
896 struct drm_display_mode *mode,
897 struct drm_display_mode *adjusted_mode);
1598 void (*mode_set)(struct drm_bridge *bridge,
1599 struct drm_display_mode *mode,
1600 struct drm_display_mode *adjusted_mode);
1601 /**
1602 * @pre_enable:
1603 *
1604 * This callback should enable the bridge. It is called right before
1605 * the preceding element in the display pipe is enabled. If the
1606 * preceding element is a bridge this means it's called before that
1607 * bridge's ->pre_enable() function. If the preceding element is a
1608 * &drm_encoder it's called right before the encoder's ->enable(),
1609 * ->commit() or ->dpms() hook from struct &drm_encoder_helper_funcs.
1610 *
1611 * The display pipe (i.e. clocks and timing signals) feeding this bridge
1612 * will not yet be running when this callback is called. The bridge must
1613 * not enable the display link feeding the next bridge in the chain (if
1614 * there is one) when this callback is called.
1615 */
898 void (*pre_enable)(struct drm_bridge *bridge);
1616 void (*pre_enable)(struct drm_bridge *bridge);
1617
1618 /**
1619 * @enable:
1620 *
1621 * This callback should enable the bridge. It is called right after
1622 * the preceding element in the display pipe is enabled. If the
1623 * preceding element is a bridge this means it's called after that
1624 * bridge's ->enable() function. If the preceding element is a
1625 * &drm_encoder it's called right after the encoder's ->enable(),
1626 * ->commit() or ->dpms() hook from struct &drm_encoder_helper_funcs.
1627 *
1628 * The bridge can assume that the display pipe (i.e. clocks and timing
1629 * signals) feeding it is running when this callback is called. This
1630 * callback must enable the display link feeding the next bridge in the
1631 * chain if there is one.
1632 */
899 void (*enable)(struct drm_bridge *bridge);
900};
901
902/**
903 * struct drm_bridge - central DRM bridge control structure
904 * @dev: DRM device this bridge belongs to
905 * @encoder: encoder to which this bridge is connected
906 * @next: the next bridge in the encoder chain

--- 14 unchanged lines hidden (view full) ---

921 const struct drm_bridge_funcs *funcs;
922 void *driver_private;
923};
924
925/**
926 * struct drm_atomic_state - the global state object for atomic updates
927 * @dev: parent DRM device
928 * @allow_modeset: allow full modeset
1633 void (*enable)(struct drm_bridge *bridge);
1634};
1635
1636/**
1637 * struct drm_bridge - central DRM bridge control structure
1638 * @dev: DRM device this bridge belongs to
1639 * @encoder: encoder to which this bridge is connected
1640 * @next: the next bridge in the encoder chain

--- 14 unchanged lines hidden (view full) ---

1655 const struct drm_bridge_funcs *funcs;
1656 void *driver_private;
1657};
1658
1659/**
1660 * struct drm_atomic_state - the global state object for atomic updates
1661 * @dev: parent DRM device
1662 * @allow_modeset: allow full modeset
929 * @legacy_cursor_update: hint to enforce legacy cursor ioctl semantics
1663 * @legacy_cursor_update: hint to enforce legacy cursor IOCTL semantics
930 * @planes: pointer to array of plane pointers
931 * @plane_states: pointer to array of plane states pointers
932 * @crtcs: pointer to array of CRTC pointers
933 * @crtc_states: pointer to array of CRTC states pointers
934 * @num_connector: size of the @connectors and @connector_states arrays
935 * @connectors: pointer to array of connector pointers
936 * @connector_states: pointer to array of connector states pointers
937 * @acquire_ctx: acquire context for this atomic modeset state update

--- 38 unchanged lines hidden (view full) ---

976 uint32_t y;
977
978 struct drm_connector **connectors;
979 size_t num_connectors;
980};
981
982/**
983 * struct drm_mode_config_funcs - basic driver provided mode setting functions
1664 * @planes: pointer to array of plane pointers
1665 * @plane_states: pointer to array of plane states pointers
1666 * @crtcs: pointer to array of CRTC pointers
1667 * @crtc_states: pointer to array of CRTC states pointers
1668 * @num_connector: size of the @connectors and @connector_states arrays
1669 * @connectors: pointer to array of connector pointers
1670 * @connector_states: pointer to array of connector states pointers
1671 * @acquire_ctx: acquire context for this atomic modeset state update

--- 38 unchanged lines hidden (view full) ---

1710 uint32_t y;
1711
1712 struct drm_connector **connectors;
1713 size_t num_connectors;
1714};
1715
1716/**
1717 * struct drm_mode_config_funcs - basic driver provided mode setting functions
984 * @fb_create: create a new framebuffer object
985 * @output_poll_changed: function to handle output configuration changes
986 * @atomic_check: check whether a given atomic state update is possible
987 * @atomic_commit: commit an atomic state update previously verified with
988 * atomic_check()
989 * @atomic_state_alloc: allocate a new atomic state
990 * @atomic_state_clear: clear the atomic state
991 * @atomic_state_free: free the atomic state
992 *
993 * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
994 * involve drivers.
995 */
996struct drm_mode_config_funcs {
1718 *
1719 * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
1720 * involve drivers.
1721 */
1722struct drm_mode_config_funcs {
1723 /**
1724 * @fb_create:
1725 *
1726 * Create a new framebuffer object. The core does basic checks on the
1727 * requested metadata, but most of that is left to the driver. See
1728 * struct &drm_mode_fb_cmd2 for details.
1729 *
1730 * RETURNS:
1731 *
1732 * A new framebuffer with an initial reference count of 1 or a negative
1733 * error code encoded with ERR_PTR().
1734 */
997 struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
998 struct drm_file *file_priv,
999 const struct drm_mode_fb_cmd2 *mode_cmd);
1735 struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
1736 struct drm_file *file_priv,
1737 const struct drm_mode_fb_cmd2 *mode_cmd);
1738
1739 /**
1740 * @output_poll_changed:
1741 *
1742 * Callback used by helpers to inform the driver of output configuration
1743 * changes.
1744 *
1745 * Drivers implementing fbdev emulation with the helpers can call
1746 * drm_fb_helper_hotplug_changed from this hook to inform the fbdev
1747 * helper of output changes.
1748 *
1749 * FIXME:
1750 *
1751 * Except that there's no vtable for device-level helper callbacks
1752 * there's no reason this is a core function.
1753 */
1000 void (*output_poll_changed)(struct drm_device *dev);
1001
1754 void (*output_poll_changed)(struct drm_device *dev);
1755
1756 /**
1757 * @atomic_check:
1758 *
1759 * This is the only hook to validate an atomic modeset update. This
1760 * function must reject any modeset and state changes which the hardware
1761 * or driver doesn't support. This includes but is of course not limited
1762 * to:
1763 *
1764 * - Checking that the modes, framebuffers, scaling and placement
1765 * requirements and so on are within the limits of the hardware.
1766 *
1767 * - Checking that any hidden shared resources are not oversubscribed.
1768 * This can be shared PLLs, shared lanes, overall memory bandwidth,
1769 * display fifo space (where shared between planes or maybe even
1770 * CRTCs).
1771 *
1772 * - Checking that virtualized resources exported to userspace are not
1773 * oversubscribed. For various reasons it can make sense to expose
1774 * more planes, crtcs or encoders than which are physically there. One
1775 * example is dual-pipe operations (which generally should be hidden
1776 * from userspace if when lockstepped in hardware, exposed otherwise),
1777 * where a plane might need 1 hardware plane (if it's just on one
1778 * pipe), 2 hardware planes (when it spans both pipes) or maybe even
1779 * shared a hardware plane with a 2nd plane (if there's a compatible
1780 * plane requested on the area handled by the other pipe).
1781 *
1782 * - Check that any transitional state is possible and that if
1783 * requested, the update can indeed be done in the vblank period
1784 * without temporarily disabling some functions.
1785 *
1786 * - Check any other constraints the driver or hardware might have.
1787 *
1788 * - This callback also needs to correctly fill out the &drm_crtc_state
1789 * in this update to make sure that drm_atomic_crtc_needs_modeset()
1790 * reflects the nature of the possible update and returns true if and
1791 * only if the update cannot be applied without tearing within one
1792 * vblank on that CRTC. The core uses that information to reject
1793 * updates which require a full modeset (i.e. blanking the screen, or
1794 * at least pausing updates for a substantial amount of time) if
1795 * userspace has disallowed that in its request.
1796 *
1797 * - The driver also does not need to repeat basic input validation
1798 * like done for the corresponding legacy entry points. The core does
1799 * that before calling this hook.
1800 *
1801 * See the documentation of @atomic_commit for an exhaustive list of
1802 * error conditions which don't have to be checked at the
1803 * ->atomic_check() stage?
1804 *
1805 * See the documentation for struct &drm_atomic_state for how exactly
1806 * an atomic modeset update is described.
1807 *
1808 * Drivers using the atomic helpers can implement this hook using
1809 * drm_atomic_helper_check(), or one of the exported sub-functions of
1810 * it.
1811 *
1812 * RETURNS:
1813 *
1814 * 0 on success or one of the below negative error codes:
1815 *
1816 * - -EINVAL, if any of the above constraints are violated.
1817 *
1818 * - -EDEADLK, when returned from an attempt to acquire an additional
1819 * &drm_modeset_lock through drm_modeset_lock().
1820 *
1821 * - -ENOMEM, if allocating additional state sub-structures failed due
1822 * to lack of memory.
1823 *
1824 * - -EINTR, -EAGAIN or -ERESTARTSYS, if the IOCTL should be restarted.
1825 * This can either be due to a pending signal, or because the driver
1826 * needs to completely bail out to recover from an exceptional
1827 * situation like a GPU hang. From a userspace point all errors are
1828 * treated equally.
1829 */
1002 int (*atomic_check)(struct drm_device *dev,
1830 int (*atomic_check)(struct drm_device *dev,
1003 struct drm_atomic_state *a);
1831 struct drm_atomic_state *state);
1832
1833 /**
1834 * @atomic_commit:
1835 *
1836 * This is the only hook to commit an atomic modeset update. The core
1837 * guarantees that @atomic_check has been called successfully before
1838 * calling this function, and that nothing has been changed in the
1839 * interim.
1840 *
1841 * See the documentation for struct &drm_atomic_state for how exactly
1842 * an atomic modeset update is described.
1843 *
1844 * Drivers using the atomic helpers can implement this hook using
1845 * drm_atomic_helper_commit(), or one of the exported sub-functions of
1846 * it.
1847 *
1848 * Asynchronous commits (as indicated with the async parameter) must
1849 * do any preparatory work which might result in an unsuccessful commit
1850 * in the context of this callback. The only exceptions are hardware
1851 * errors resulting in -EIO. But even in that case the driver must
1852 * ensure that the display pipe is at least running, to avoid
1853 * compositors crashing when pageflips don't work. Anything else,
1854 * specifically committing the update to the hardware, should be done
1855 * without blocking the caller. For updates which do not require a
1856 * modeset this must be guaranteed.
1857 *
1858 * The driver must wait for any pending rendering to the new
1859 * framebuffers to complete before executing the flip. It should also
1860 * wait for any pending rendering from other drivers if the underlying
1861 * buffer is a shared dma-buf. Asynchronous commits must not wait for
1862 * rendering in the context of this callback.
1863 *
1864 * An application can request to be notified when the atomic commit has
1865 * completed. These events are per-CRTC and can be distinguished by the
1866 * CRTC index supplied in &drm_event to userspace.
1867 *
1868 * The drm core will supply a struct &drm_event in the event
1869 * member of each CRTC's &drm_crtc_state structure. This can be handled by the
1870 * drm_crtc_send_vblank_event() function, which the driver should call on
1871 * the provided event upon completion of the atomic commit. Note that if
1872 * the driver supports vblank signalling and timestamping the vblank
1873 * counters and timestamps must agree with the ones returned from page
1874 * flip events. With the current vblank helper infrastructure this can
1875 * be achieved by holding a vblank reference while the page flip is
1876 * pending, acquired through drm_crtc_vblank_get() and released with
1877 * drm_crtc_vblank_put(). Drivers are free to implement their own vblank
1878 * counter and timestamp tracking though, e.g. if they have accurate
1879 * timestamp registers in hardware.
1880 *
1881 * NOTE:
1882 *
1883 * Drivers are not allowed to shut down any display pipe successfully
1884 * enabled through an atomic commit on their own. Doing so can result in
1885 * compositors crashing if a page flip is suddenly rejected because the
1886 * pipe is off.
1887 *
1888 * RETURNS:
1889 *
1890 * 0 on success or one of the below negative error codes:
1891 *
1892 * - -EBUSY, if an asynchronous updated is requested and there is
1893 * an earlier updated pending. Drivers are allowed to support a queue
1894 * of outstanding updates, but currently no driver supports that.
1895 * Note that drivers must wait for preceding updates to complete if a
1896 * synchronous update is requested, they are not allowed to fail the
1897 * commit in that case.
1898 *
1899 * - -ENOMEM, if the driver failed to allocate memory. Specifically
1900 * this can happen when trying to pin framebuffers, which must only
1901 * be done when committing the state.
1902 *
1903 * - -ENOSPC, as a refinement of the more generic -ENOMEM to indicate
1904 * that the driver has run out of vram, iommu space or similar GPU
1905 * address space needed for framebuffer.
1906 *
1907 * - -EIO, if the hardware completely died.
1908 *
1909 * - -EINTR, -EAGAIN or -ERESTARTSYS, if the IOCTL should be restarted.
1910 * This can either be due to a pending signal, or because the driver
1911 * needs to completely bail out to recover from an exceptional
1912 * situation like a GPU hang. From a userspace point of view all errors are
1913 * treated equally.
1914 *
1915 * This list is exhaustive. Specifically this hook is not allowed to
1916 * return -EINVAL (any invalid requests should be caught in
1917 * @atomic_check) or -EDEADLK (this function must not acquire
1918 * additional modeset locks).
1919 */
1004 int (*atomic_commit)(struct drm_device *dev,
1920 int (*atomic_commit)(struct drm_device *dev,
1005 struct drm_atomic_state *a,
1921 struct drm_atomic_state *state,
1006 bool async);
1922 bool async);
1923
1924 /**
1925 * @atomic_state_alloc:
1926 *
1927 * This optional hook can be used by drivers that want to subclass struct
1928 * &drm_atomic_state to be able to track their own driver-private global
1929 * state easily. If this hook is implemented, drivers must also
1930 * implement @atomic_state_clear and @atomic_state_free.
1931 *
1932 * RETURNS:
1933 *
1934 * A new &drm_atomic_state on success or NULL on failure.
1935 */
1007 struct drm_atomic_state *(*atomic_state_alloc)(struct drm_device *dev);
1936 struct drm_atomic_state *(*atomic_state_alloc)(struct drm_device *dev);
1937
1938 /**
1939 * @atomic_state_clear:
1940 *
1941 * This hook must clear any driver private state duplicated into the
1942 * passed-in &drm_atomic_state. This hook is called when the caller
1943 * encountered a &drm_modeset_lock deadlock and needs to drop all
1944 * already acquired locks as part of the deadlock avoidance dance
1945 * implemented in drm_modeset_lock_backoff().
1946 *
1947 * Any duplicated state must be invalidated since a concurrent atomic
1948 * update might change it, and the drm atomic interfaces always apply
1949 * updates as relative changes to the current state.
1950 *
1951 * Drivers that implement this must call drm_atomic_state_default_clear()
1952 * to clear common state.
1953 */
1008 void (*atomic_state_clear)(struct drm_atomic_state *state);
1954 void (*atomic_state_clear)(struct drm_atomic_state *state);
1955
1956 /**
1957 * @atomic_state_free:
1958 *
1959 * This hook needs driver private resources and the &drm_atomic_state
1960 * itself. Note that the core first calls drm_atomic_state_clear() to
1961 * avoid code duplicate between the clear and free hooks.
1962 *
1963 * Drivers that implement this must call drm_atomic_state_default_free()
1964 * to release common resources.
1965 */
1009 void (*atomic_state_free)(struct drm_atomic_state *state);
1010};
1011
1012/**
1013 * struct drm_mode_config - Mode configuration control structure
1014 * @mutex: mutex protecting KMS related lists and structures
1015 * @connection_mutex: ww mutex protecting connector state and routing
1016 * @acquire_ctx: global implicit acquire context used by atomic drivers for
1966 void (*atomic_state_free)(struct drm_atomic_state *state);
1967};
1968
1969/**
1970 * struct drm_mode_config - Mode configuration control structure
1971 * @mutex: mutex protecting KMS related lists and structures
1972 * @connection_mutex: ww mutex protecting connector state and routing
1973 * @acquire_ctx: global implicit acquire context used by atomic drivers for
1017 * legacy ioctls
1974 * legacy IOCTLs
1018 * @idr_mutex: mutex for KMS ID allocation and management
1019 * @crtc_idr: main KMS ID tracking object
1020 * @fb_lock: mutex to protect fb state and lists
1021 * @num_fb: number of fbs available
1022 * @fb_list: list of framebuffers available
1023 * @num_connector: number of connectors on this device
1024 * @connector_list: list of connector objects
1025 * @num_encoder: number of encoders on this device

--- 156 unchanged lines hidden (view full) ---

1182#define obj_to_blob(x) container_of(x, struct drm_property_blob, base)
1183#define obj_to_plane(x) container_of(x, struct drm_plane, base)
1184
1185struct drm_prop_enum_list {
1186 int type;
1187 char *name;
1188};
1189
1975 * @idr_mutex: mutex for KMS ID allocation and management
1976 * @crtc_idr: main KMS ID tracking object
1977 * @fb_lock: mutex to protect fb state and lists
1978 * @num_fb: number of fbs available
1979 * @fb_list: list of framebuffers available
1980 * @num_connector: number of connectors on this device
1981 * @connector_list: list of connector objects
1982 * @num_encoder: number of encoders on this device

--- 156 unchanged lines hidden (view full) ---

2139#define obj_to_blob(x) container_of(x, struct drm_property_blob, base)
2140#define obj_to_plane(x) container_of(x, struct drm_plane, base)
2141
2142struct drm_prop_enum_list {
2143 int type;
2144 char *name;
2145};
2146
1190extern int drm_crtc_init_with_planes(struct drm_device *dev,
1191 struct drm_crtc *crtc,
1192 struct drm_plane *primary,
1193 struct drm_plane *cursor,
1194 const struct drm_crtc_funcs *funcs);
2147extern __printf(6, 7)
2148int drm_crtc_init_with_planes(struct drm_device *dev,
2149 struct drm_crtc *crtc,
2150 struct drm_plane *primary,
2151 struct drm_plane *cursor,
2152 const struct drm_crtc_funcs *funcs,
2153 const char *name, ...);
1195extern void drm_crtc_cleanup(struct drm_crtc *crtc);
1196extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
1197
1198/**
1199 * drm_crtc_mask - find the mask of a registered CRTC
1200 * @crtc: CRTC to find mask for
1201 *
1202 * Given a registered CRTC, return the mask bit of that CRTC for an

--- 387 unchanged lines hidden ---
2154extern void drm_crtc_cleanup(struct drm_crtc *crtc);
2155extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
2156
2157/**
2158 * drm_crtc_mask - find the mask of a registered CRTC
2159 * @crtc: CRTC to find mask for
2160 *
2161 * Given a registered CRTC, return the mask bit of that CRTC for an

--- 387 unchanged lines hidden ---