forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdrm_connector.h
2131 lines (1915 loc) · 65 KB
/
drm_connector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright (c) 2016 Intel Corporation
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of the copyright holders not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. The copyright holders make no representations
* about the suitability of this software for any purpose. It is provided "as
* is" without express or implied warranty.
*
* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
#ifndef __DRM_CONNECTOR_H__
#define __DRM_CONNECTOR_H__
#include <linux/list.h>
#include <linux/llist.h>
#include <linux/ctype.h>
#include <linux/hdmi.h>
#include <linux/notifier.h>
#include <drm/drm_mode_object.h>
#include <drm/drm_util.h>
#include <drm/drm_property.h>
#include <uapi/drm/drm_mode.h>
struct drm_connector_helper_funcs;
struct drm_modeset_acquire_ctx;
struct drm_device;
struct drm_crtc;
struct drm_encoder;
struct drm_panel;
struct drm_property;
struct drm_property_blob;
struct drm_printer;
struct drm_privacy_screen;
struct edid;
struct i2c_adapter;
enum drm_connector_force {
DRM_FORCE_UNSPECIFIED,
DRM_FORCE_OFF,
DRM_FORCE_ON, /* force on analog part normally */
DRM_FORCE_ON_DIGITAL, /* for DVI-I use digital connector */
};
/**
* enum drm_connector_status - status for a &drm_connector
*
* This enum is used to track the connector status. There are no separate
* #defines for the uapi!
*/
enum drm_connector_status {
/**
* @connector_status_connected: The connector is definitely connected to
* a sink device, and can be enabled.
*/
connector_status_connected = 1,
/**
* @connector_status_disconnected: The connector isn't connected to a
* sink device which can be autodetect. For digital outputs like DP or
* HDMI (which can be realiable probed) this means there's really
* nothing there. It is driver-dependent whether a connector with this
* status can be lit up or not.
*/
connector_status_disconnected = 2,
/**
* @connector_status_unknown: The connector's status could not be
* reliably detected. This happens when probing would either cause
* flicker (like load-detection when the connector is in use), or when a
* hardware resource isn't available (like when load-detection needs a
* free CRTC). It should be possible to light up the connector with one
* of the listed fallback modes. For default configuration userspace
* should only try to light up connectors with unknown status when
* there's not connector with @connector_status_connected.
*/
connector_status_unknown = 3,
};
/**
* enum drm_connector_registration_state - userspace registration status for
* a &drm_connector
*
* This enum is used to track the status of initializing a connector and
* registering it with userspace, so that DRM can prevent bogus modesets on
* connectors that no longer exist.
*/
enum drm_connector_registration_state {
/**
* @DRM_CONNECTOR_INITIALIZING: The connector has just been created,
* but has yet to be exposed to userspace. There should be no
* additional restrictions to how the state of this connector may be
* modified.
*/
DRM_CONNECTOR_INITIALIZING = 0,
/**
* @DRM_CONNECTOR_REGISTERED: The connector has been fully initialized
* and registered with sysfs, as such it has been exposed to
* userspace. There should be no additional restrictions to how the
* state of this connector may be modified.
*/
DRM_CONNECTOR_REGISTERED = 1,
/**
* @DRM_CONNECTOR_UNREGISTERED: The connector has either been exposed
* to userspace and has since been unregistered and removed from
* userspace, or the connector was unregistered before it had a chance
* to be exposed to userspace (e.g. still in the
* @DRM_CONNECTOR_INITIALIZING state). When a connector is
* unregistered, there are additional restrictions to how its state
* may be modified:
*
* - An unregistered connector may only have its DPMS changed from
* On->Off. Once DPMS is changed to Off, it may not be switched back
* to On.
* - Modesets are not allowed on unregistered connectors, unless they
* would result in disabling its assigned CRTCs. This means
* disabling a CRTC on an unregistered connector is OK, but enabling
* one is not.
* - Removing a CRTC from an unregistered connector is OK, but new
* CRTCs may never be assigned to an unregistered connector.
*/
DRM_CONNECTOR_UNREGISTERED = 2,
};
enum subpixel_order {
SubPixelUnknown = 0,
SubPixelHorizontalRGB,
SubPixelHorizontalBGR,
SubPixelVerticalRGB,
SubPixelVerticalBGR,
SubPixelNone,
};
/**
* enum drm_connector_tv_mode - Analog TV output mode
*
* This enum is used to indicate the TV output mode used on an analog TV
* connector.
*
* WARNING: The values of this enum is uABI since they're exposed in the
* "TV mode" connector property.
*/
enum drm_connector_tv_mode {
/**
* @DRM_MODE_TV_MODE_NTSC: CCIR System M (aka 525-lines)
* together with the NTSC Color Encoding.
*/
DRM_MODE_TV_MODE_NTSC,
/**
* @DRM_MODE_TV_MODE_NTSC_443: Variant of
* @DRM_MODE_TV_MODE_NTSC. Uses a color subcarrier frequency
* of 4.43 MHz.
*/
DRM_MODE_TV_MODE_NTSC_443,
/**
* @DRM_MODE_TV_MODE_NTSC_J: Variant of @DRM_MODE_TV_MODE_NTSC
* used in Japan. Uses a black level equals to the blanking
* level.
*/
DRM_MODE_TV_MODE_NTSC_J,
/**
* @DRM_MODE_TV_MODE_PAL: CCIR System B together with the PAL
* color system.
*/
DRM_MODE_TV_MODE_PAL,
/**
* @DRM_MODE_TV_MODE_PAL_M: CCIR System M (aka 525-lines)
* together with the PAL color encoding
*/
DRM_MODE_TV_MODE_PAL_M,
/**
* @DRM_MODE_TV_MODE_PAL_N: CCIR System N together with the PAL
* color encoding. It uses 625 lines, but has a color subcarrier
* frequency of 3.58MHz, the SECAM color space, and narrower
* channels compared to most of the other PAL variants.
*/
DRM_MODE_TV_MODE_PAL_N,
/**
* @DRM_MODE_TV_MODE_SECAM: CCIR System B together with the
* SECAM color system.
*/
DRM_MODE_TV_MODE_SECAM,
/**
* @DRM_MODE_TV_MODE_MAX: Number of analog TV output modes.
*
* Internal implementation detail; this is not uABI.
*/
DRM_MODE_TV_MODE_MAX,
};
/**
* struct drm_scrambling: sink's scrambling support.
*/
struct drm_scrambling {
/**
* @supported: scrambling supported for rates > 340 Mhz.
*/
bool supported;
/**
* @low_rates: scrambling supported for rates <= 340 Mhz.
*/
bool low_rates;
};
/*
* struct drm_scdc - Information about scdc capabilities of a HDMI 2.0 sink
*
* Provides SCDC register support and capabilities related information on a
* HDMI 2.0 sink. In case of a HDMI 1.4 sink, all parameter must be 0.
*/
struct drm_scdc {
/**
* @supported: status control & data channel present.
*/
bool supported;
/**
* @read_request: sink is capable of generating scdc read request.
*/
bool read_request;
/**
* @scrambling: sink's scrambling capabilities
*/
struct drm_scrambling scrambling;
};
/**
* struct drm_hdmi_dsc_cap - DSC capabilities of HDMI sink
*
* Describes the DSC support provided by HDMI 2.1 sink.
* The information is fetched fom additional HFVSDB blocks defined
* for HDMI 2.1.
*/
struct drm_hdmi_dsc_cap {
/** @v_1p2: flag for dsc1.2 version support by sink */
bool v_1p2;
/** @native_420: Does sink support DSC with 4:2:0 compression */
bool native_420;
/**
* @all_bpp: Does sink support all bpp with 4:4:4: or 4:2:2
* compressed formats
*/
bool all_bpp;
/**
* @bpc_supported: compressed bpc supported by sink : 10, 12 or 16 bpc
*/
u8 bpc_supported;
/** @max_slices: maximum number of Horizontal slices supported by */
u8 max_slices;
/** @clk_per_slice : max pixel clock in MHz supported per slice */
int clk_per_slice;
/** @max_lanes : dsc max lanes supported for Fixed rate Link training */
u8 max_lanes;
/** @max_frl_rate_per_lane : maximum frl rate with DSC per lane */
u8 max_frl_rate_per_lane;
/** @total_chunk_kbytes: max size of chunks in KBs supported per line*/
u8 total_chunk_kbytes;
};
/**
* struct drm_hdmi_info - runtime information about the connected HDMI sink
*
* Describes if a given display supports advanced HDMI 2.0 features.
* This information is available in CEA-861-F extension blocks (like HF-VSDB).
*/
struct drm_hdmi_info {
/** @scdc: sink's scdc support and capabilities */
struct drm_scdc scdc;
/**
* @y420_vdb_modes: bitmap of modes which can support ycbcr420
* output only (not normal RGB/YCBCR444/422 outputs). The max VIC
* defined by the CEA-861-G spec is 219, so the size is 256 bits to map
* up to 256 VICs.
*/
unsigned long y420_vdb_modes[BITS_TO_LONGS(256)];
/**
* @y420_cmdb_modes: bitmap of modes which can support ycbcr420
* output also, along with normal HDMI outputs. The max VIC defined by
* the CEA-861-G spec is 219, so the size is 256 bits to map up to 256
* VICs.
*/
unsigned long y420_cmdb_modes[BITS_TO_LONGS(256)];
/** @y420_dc_modes: bitmap of deep color support index */
u8 y420_dc_modes;
/** @max_frl_rate_per_lane: support fixed rate link */
u8 max_frl_rate_per_lane;
/** @max_lanes: supported by sink */
u8 max_lanes;
/** @dsc_cap: DSC capabilities of the sink */
struct drm_hdmi_dsc_cap dsc_cap;
};
/**
* enum drm_link_status - connector's link_status property value
*
* This enum is used as the connector's link status property value.
* It is set to the values defined in uapi.
*
* @DRM_LINK_STATUS_GOOD: DP Link is Good as a result of successful
* link training
* @DRM_LINK_STATUS_BAD: DP Link is BAD as a result of link training
* failure
*/
enum drm_link_status {
DRM_LINK_STATUS_GOOD = DRM_MODE_LINK_STATUS_GOOD,
DRM_LINK_STATUS_BAD = DRM_MODE_LINK_STATUS_BAD,
};
/**
* enum drm_panel_orientation - panel_orientation info for &drm_display_info
*
* This enum is used to track the (LCD) panel orientation. There are no
* separate #defines for the uapi!
*
* @DRM_MODE_PANEL_ORIENTATION_UNKNOWN: The drm driver has not provided any
* panel orientation information (normal
* for non panels) in this case the "panel
* orientation" connector prop will not be
* attached.
* @DRM_MODE_PANEL_ORIENTATION_NORMAL: The top side of the panel matches the
* top side of the device's casing.
* @DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP: The top side of the panel matches the
* bottom side of the device's casing, iow
* the panel is mounted upside-down.
* @DRM_MODE_PANEL_ORIENTATION_LEFT_UP: The left side of the panel matches the
* top side of the device's casing.
* @DRM_MODE_PANEL_ORIENTATION_RIGHT_UP: The right side of the panel matches the
* top side of the device's casing.
*/
enum drm_panel_orientation {
DRM_MODE_PANEL_ORIENTATION_UNKNOWN = -1,
DRM_MODE_PANEL_ORIENTATION_NORMAL = 0,
DRM_MODE_PANEL_ORIENTATION_BOTTOM_UP,
DRM_MODE_PANEL_ORIENTATION_LEFT_UP,
DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
};
/**
* struct drm_monitor_range_info - Panel's Monitor range in EDID for
* &drm_display_info
*
* This struct is used to store a frequency range supported by panel
* as parsed from EDID's detailed monitor range descriptor block.
*
* @min_vfreq: This is the min supported refresh rate in Hz from
* EDID's detailed monitor range.
* @max_vfreq: This is the max supported refresh rate in Hz from
* EDID's detailed monitor range
*/
struct drm_monitor_range_info {
u16 min_vfreq;
u16 max_vfreq;
};
/**
* struct drm_luminance_range_info - Panel's luminance range for
* &drm_display_info. Calculated using data in EDID
*
* This struct is used to store a luminance range supported by panel
* as calculated using data from EDID's static hdr metadata.
*
* @min_luminance: This is the min supported luminance value
*
* @max_luminance: This is the max supported luminance value
*/
struct drm_luminance_range_info {
u32 min_luminance;
u32 max_luminance;
};
/**
* enum drm_privacy_screen_status - privacy screen status
*
* This enum is used to track and control the state of the integrated privacy
* screen present on some display panels, via the "privacy-screen sw-state"
* and "privacy-screen hw-state" properties. Note the _LOCKED enum values
* are only valid for the "privacy-screen hw-state" property.
*
* @PRIVACY_SCREEN_DISABLED:
* The privacy-screen on the panel is disabled
* @PRIVACY_SCREEN_ENABLED:
* The privacy-screen on the panel is enabled
* @PRIVACY_SCREEN_DISABLED_LOCKED:
* The privacy-screen on the panel is disabled and locked (cannot be changed)
* @PRIVACY_SCREEN_ENABLED_LOCKED:
* The privacy-screen on the panel is enabled and locked (cannot be changed)
*/
enum drm_privacy_screen_status {
PRIVACY_SCREEN_DISABLED = 0,
PRIVACY_SCREEN_ENABLED,
PRIVACY_SCREEN_DISABLED_LOCKED,
PRIVACY_SCREEN_ENABLED_LOCKED,
};
/**
* enum drm_colorspace - color space
*
* This enum is a consolidated colorimetry list supported by HDMI and
* DP protocol standard. The respective connectors will register
* a property with the subset of this list (supported by that
* respective protocol). Userspace will set the colorspace through
* a colorspace property which will be created and exposed to
* userspace.
*
* DP definitions come from the DP v2.0 spec
* HDMI definitions come from the CTA-861-H spec
*
* A note on YCC and RGB variants:
*
* Since userspace is not aware of the encoding on the wire
* (RGB or YCbCr), drivers are free to pick the appropriate
* variant, regardless of what userspace selects. E.g., if
* BT2020_RGB is selected by userspace a driver will pick
* BT2020_YCC if the encoding on the wire is YUV444 or YUV420.
*
* @DRM_MODE_COLORIMETRY_DEFAULT:
* Driver specific behavior.
* @DRM_MODE_COLORIMETRY_NO_DATA:
* Driver specific behavior.
* @DRM_MODE_COLORIMETRY_SMPTE_170M_YCC:
* (HDMI)
* SMPTE ST 170M colorimetry format
* @DRM_MODE_COLORIMETRY_BT709_YCC:
* (HDMI, DP)
* ITU-R BT.709 colorimetry format
* @DRM_MODE_COLORIMETRY_XVYCC_601:
* (HDMI, DP)
* xvYCC601 colorimetry format
* @DRM_MODE_COLORIMETRY_XVYCC_709:
* (HDMI, DP)
* xvYCC709 colorimetry format
* @DRM_MODE_COLORIMETRY_SYCC_601:
* (HDMI, DP)
* sYCC601 colorimetry format
* @DRM_MODE_COLORIMETRY_OPYCC_601:
* (HDMI, DP)
* opYCC601 colorimetry format
* @DRM_MODE_COLORIMETRY_OPRGB:
* (HDMI, DP)
* opRGB colorimetry format
* @DRM_MODE_COLORIMETRY_BT2020_CYCC:
* (HDMI, DP)
* ITU-R BT.2020 Y'c C'bc C'rc (constant luminance) colorimetry format
* @DRM_MODE_COLORIMETRY_BT2020_RGB:
* (HDMI, DP)
* ITU-R BT.2020 R' G' B' colorimetry format
* @DRM_MODE_COLORIMETRY_BT2020_YCC:
* (HDMI, DP)
* ITU-R BT.2020 Y' C'b C'r colorimetry format
* @DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65:
* (HDMI)
* SMPTE ST 2113 P3D65 colorimetry format
* @DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER:
* (HDMI)
* SMPTE ST 2113 P3DCI colorimetry format
* @DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED:
* (DP)
* RGB wide gamut fixed point colorimetry format
* @DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT:
* (DP)
* RGB wide gamut floating point
* (scRGB (IEC 61966-2-2)) colorimetry format
* @DRM_MODE_COLORIMETRY_BT601_YCC:
* (DP)
* ITU-R BT.601 colorimetry format
* The DP spec does not say whether this is the 525 or the 625
* line version.
* @DRM_MODE_COLORIMETRY_COUNT:
* Not a valid value; merely used four counting
*/
enum drm_colorspace {
/* For Default case, driver will set the colorspace */
DRM_MODE_COLORIMETRY_DEFAULT = 0,
/* CEA 861 Normal Colorimetry options */
DRM_MODE_COLORIMETRY_NO_DATA = 0,
DRM_MODE_COLORIMETRY_SMPTE_170M_YCC = 1,
DRM_MODE_COLORIMETRY_BT709_YCC = 2,
/* CEA 861 Extended Colorimetry Options */
DRM_MODE_COLORIMETRY_XVYCC_601 = 3,
DRM_MODE_COLORIMETRY_XVYCC_709 = 4,
DRM_MODE_COLORIMETRY_SYCC_601 = 5,
DRM_MODE_COLORIMETRY_OPYCC_601 = 6,
DRM_MODE_COLORIMETRY_OPRGB = 7,
DRM_MODE_COLORIMETRY_BT2020_CYCC = 8,
DRM_MODE_COLORIMETRY_BT2020_RGB = 9,
DRM_MODE_COLORIMETRY_BT2020_YCC = 10,
/* Additional Colorimetry extension added as part of CTA 861.G */
DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 = 11,
DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER = 12,
/* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */
DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED = 13,
DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT = 14,
DRM_MODE_COLORIMETRY_BT601_YCC = 15,
DRM_MODE_COLORIMETRY_COUNT
};
/**
* enum drm_bus_flags - bus_flags info for &drm_display_info
*
* This enum defines signal polarities and clock edge information for signals on
* a bus as bitmask flags.
*
* The clock edge information is conveyed by two sets of symbols,
* DRM_BUS_FLAGS_*_DRIVE_\* and DRM_BUS_FLAGS_*_SAMPLE_\*. When this enum is
* used to describe a bus from the point of view of the transmitter, the
* \*_DRIVE_\* flags should be used. When used from the point of view of the
* receiver, the \*_SAMPLE_\* flags should be used. The \*_DRIVE_\* and
* \*_SAMPLE_\* flags alias each other, with the \*_SAMPLE_POSEDGE and
* \*_SAMPLE_NEGEDGE flags being equal to \*_DRIVE_NEGEDGE and \*_DRIVE_POSEDGE
* respectively. This simplifies code as signals are usually sampled on the
* opposite edge of the driving edge. Transmitters and receivers may however
* need to take other signal timings into account to convert between driving
* and sample edges.
*/
enum drm_bus_flags {
/**
* @DRM_BUS_FLAG_DE_LOW:
*
* The Data Enable signal is active low
*/
DRM_BUS_FLAG_DE_LOW = BIT(0),
/**
* @DRM_BUS_FLAG_DE_HIGH:
*
* The Data Enable signal is active high
*/
DRM_BUS_FLAG_DE_HIGH = BIT(1),
/**
* @DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE:
*
* Data is driven on the rising edge of the pixel clock
*/
DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE = BIT(2),
/**
* @DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE:
*
* Data is driven on the falling edge of the pixel clock
*/
DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE = BIT(3),
/**
* @DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE:
*
* Data is sampled on the rising edge of the pixel clock
*/
DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE = DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
/**
* @DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE:
*
* Data is sampled on the falling edge of the pixel clock
*/
DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
/**
* @DRM_BUS_FLAG_DATA_MSB_TO_LSB:
*
* Data is transmitted MSB to LSB on the bus
*/
DRM_BUS_FLAG_DATA_MSB_TO_LSB = BIT(4),
/**
* @DRM_BUS_FLAG_DATA_LSB_TO_MSB:
*
* Data is transmitted LSB to MSB on the bus
*/
DRM_BUS_FLAG_DATA_LSB_TO_MSB = BIT(5),
/**
* @DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE:
*
* Sync signals are driven on the rising edge of the pixel clock
*/
DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE = BIT(6),
/**
* @DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE:
*
* Sync signals are driven on the falling edge of the pixel clock
*/
DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE = BIT(7),
/**
* @DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE:
*
* Sync signals are sampled on the rising edge of the pixel clock
*/
DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
/**
* @DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE:
*
* Sync signals are sampled on the falling edge of the pixel clock
*/
DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE = DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
/**
* @DRM_BUS_FLAG_SHARP_SIGNALS:
*
* Set if the Sharp-specific signals (SPL, CLS, PS, REV) must be used
*/
DRM_BUS_FLAG_SHARP_SIGNALS = BIT(8),
};
/**
* struct drm_display_info - runtime data about the connected sink
*
* Describes a given display (e.g. CRT or flat panel) and its limitations. For
* fixed display sinks like built-in panels there's not much difference between
* this and &struct drm_connector. But for sinks with a real cable this
* structure is meant to describe all the things at the other end of the cable.
*
* For sinks which provide an EDID this can be filled out by calling
* drm_add_edid_modes().
*/
struct drm_display_info {
/**
* @width_mm: Physical width in mm.
*/
unsigned int width_mm;
/**
* @height_mm: Physical height in mm.
*/
unsigned int height_mm;
/**
* @bpc: Maximum bits per color channel. Used by HDMI and DP outputs.
*/
unsigned int bpc;
/**
* @subpixel_order: Subpixel order of LCD panels.
*/
enum subpixel_order subpixel_order;
#define DRM_COLOR_FORMAT_RGB444 (1<<0)
#define DRM_COLOR_FORMAT_YCBCR444 (1<<1)
#define DRM_COLOR_FORMAT_YCBCR422 (1<<2)
#define DRM_COLOR_FORMAT_YCBCR420 (1<<3)
/**
* @panel_orientation: Read only connector property for built-in panels,
* indicating the orientation of the panel vs the device's casing.
* drm_connector_init() sets this to DRM_MODE_PANEL_ORIENTATION_UNKNOWN.
* When not UNKNOWN this gets used by the drm_fb_helpers to rotate the
* fb to compensate and gets exported as prop to userspace.
*/
int panel_orientation;
/**
* @color_formats: HDMI Color formats, selects between RGB and YCrCb
* modes. Used DRM_COLOR_FORMAT\_ defines, which are _not_ the same ones
* as used to describe the pixel format in framebuffers, and also don't
* match the formats in @bus_formats which are shared with v4l.
*/
u32 color_formats;
/**
* @bus_formats: Pixel data format on the wire, somewhat redundant with
* @color_formats. Array of size @num_bus_formats encoded using
* MEDIA_BUS_FMT\_ defines shared with v4l and media drivers.
*/
const u32 *bus_formats;
/**
* @num_bus_formats: Size of @bus_formats array.
*/
unsigned int num_bus_formats;
/**
* @bus_flags: Additional information (like pixel signal polarity) for
* the pixel data on the bus, using &enum drm_bus_flags values
* DRM_BUS_FLAGS\_.
*/
u32 bus_flags;
/**
* @max_tmds_clock: Maximum TMDS clock rate supported by the
* sink in kHz. 0 means undefined.
*/
int max_tmds_clock;
/**
* @dvi_dual: Dual-link DVI sink?
*/
bool dvi_dual;
/**
* @is_hdmi: True if the sink is an HDMI device.
*
* This field shall be used instead of calling
* drm_detect_hdmi_monitor() when possible.
*/
bool is_hdmi;
/**
* @has_audio: True if the sink supports audio.
*
* This field shall be used instead of calling
* drm_detect_monitor_audio() when possible.
*/
bool has_audio;
/**
* @has_hdmi_infoframe: Does the sink support the HDMI infoframe?
*/
bool has_hdmi_infoframe;
/**
* @rgb_quant_range_selectable: Does the sink support selecting
* the RGB quantization range?
*/
bool rgb_quant_range_selectable;
/**
* @edid_hdmi_rgb444_dc_modes: Mask of supported hdmi deep color modes
* in RGB 4:4:4. Even more stuff redundant with @bus_formats.
*/
u8 edid_hdmi_rgb444_dc_modes;
/**
* @edid_hdmi_ycbcr444_dc_modes: Mask of supported hdmi deep color
* modes in YCbCr 4:4:4. Even more stuff redundant with @bus_formats.
*/
u8 edid_hdmi_ycbcr444_dc_modes;
/**
* @cea_rev: CEA revision of the HDMI sink.
*/
u8 cea_rev;
/**
* @hdmi: advance features of a HDMI sink.
*/
struct drm_hdmi_info hdmi;
/**
* @non_desktop: Non desktop display (HMD).
*/
bool non_desktop;
/**
* @monitor_range: Frequency range supported by monitor range descriptor
*/
struct drm_monitor_range_info monitor_range;
/**
* @luminance_range: Luminance range supported by panel
*/
struct drm_luminance_range_info luminance_range;
/**
* @mso_stream_count: eDP Multi-SST Operation (MSO) stream count from
* the DisplayID VESA vendor block. 0 for conventional Single-Stream
* Transport (SST), or 2 or 4 MSO streams.
*/
u8 mso_stream_count;
/**
* @mso_pixel_overlap: eDP MSO segment pixel overlap, 0-8 pixels.
*/
u8 mso_pixel_overlap;
/**
* @max_dsc_bpp: Maximum DSC target bitrate, if it is set to 0 the
* monitor's default value is used instead.
*/
u32 max_dsc_bpp;
/**
* @vics: Array of vics_len VICs. Internal to EDID parsing.
*/
u8 *vics;
/**
* @vics_len: Number of elements in vics. Internal to EDID parsing.
*/
int vics_len;
/**
* @quirks: EDID based quirks. Internal to EDID parsing.
*/
u32 quirks;
/**
* @source_physical_address: Source Physical Address from HDMI
* Vendor-Specific Data Block, for CEC usage.
*
* Defaults to CEC_PHYS_ADDR_INVALID (0xffff).
*/
u16 source_physical_address;
};
int drm_display_info_set_bus_formats(struct drm_display_info *info,
const u32 *formats,
unsigned int num_formats);
/**
* struct drm_connector_tv_margins - TV connector related margins
*
* Describes the margins in pixels to put around the image on TV
* connectors to deal with overscan.
*/
struct drm_connector_tv_margins {
/**
* @bottom: Bottom margin in pixels.
*/
unsigned int bottom;
/**
* @left: Left margin in pixels.
*/
unsigned int left;
/**
* @right: Right margin in pixels.
*/
unsigned int right;
/**
* @top: Top margin in pixels.
*/
unsigned int top;
};
/**
* struct drm_tv_connector_state - TV connector related states
* @select_subconnector: selected subconnector
* @subconnector: detected subconnector
* @margins: TV margins
* @legacy_mode: Legacy TV mode, driver specific value
* @mode: TV mode
* @brightness: brightness in percent
* @contrast: contrast in percent
* @flicker_reduction: flicker reduction in percent
* @overscan: overscan in percent
* @saturation: saturation in percent
* @hue: hue in percent
*/
struct drm_tv_connector_state {
enum drm_mode_subconnector select_subconnector;
enum drm_mode_subconnector subconnector;
struct drm_connector_tv_margins margins;
unsigned int legacy_mode;
unsigned int mode;
unsigned int brightness;
unsigned int contrast;
unsigned int flicker_reduction;
unsigned int overscan;
unsigned int saturation;
unsigned int hue;
};
/**
* struct drm_connector_state - mutable connector state
*/
struct drm_connector_state {
/** @connector: backpointer to the connector */
struct drm_connector *connector;
/**
* @crtc: CRTC to connect connector to, NULL if disabled.
*
* Do not change this directly, use drm_atomic_set_crtc_for_connector()
* instead.
*/
struct drm_crtc *crtc;
/**
* @best_encoder:
*
* Used by the atomic helpers to select the encoder, through the
* &drm_connector_helper_funcs.atomic_best_encoder or
* &drm_connector_helper_funcs.best_encoder callbacks.
*
* This is also used in the atomic helpers to map encoders to their
* current and previous connectors, see
* drm_atomic_get_old_connector_for_encoder() and
* drm_atomic_get_new_connector_for_encoder().
*
* NOTE: Atomic drivers must fill this out (either themselves or through
* helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
* not return correct data to userspace.
*/
struct drm_encoder *best_encoder;
/**
* @link_status: Connector link_status to keep track of whether link is
* GOOD or BAD to notify userspace if retraining is necessary.
*/
enum drm_link_status link_status;
/** @state: backpointer to global drm_atomic_state */
struct drm_atomic_state *state;
/**
* @commit: Tracks the pending commit to prevent use-after-free conditions.
*
* Is only set when @crtc is NULL.
*/
struct drm_crtc_commit *commit;
/** @tv: TV connector state */
struct drm_tv_connector_state tv;
/**
* @self_refresh_aware:
*
* This tracks whether a connector is aware of the self refresh state.
* It should be set to true for those connector implementations which
* understand the self refresh state. This is needed since the crtc
* registers the self refresh helpers and it doesn't know if the
* connectors downstream have implemented self refresh entry/exit.
*
* Drivers should set this to true in atomic_check if they know how to
* handle self_refresh requests.
*/
bool self_refresh_aware;
/**
* @picture_aspect_ratio: Connector property to control the
* HDMI infoframe aspect ratio setting.
*
* The %DRM_MODE_PICTURE_ASPECT_\* values much match the
* values for &enum hdmi_picture_aspect
*/
enum hdmi_picture_aspect picture_aspect_ratio;
/**
* @content_type: Connector property to control the
* HDMI infoframe content type setting.
* The %DRM_MODE_CONTENT_TYPE_\* values much
* match the values.
*/
unsigned int content_type;
/**
* @hdcp_content_type: Connector property to pass the type of
* protected content. This is most commonly used for HDCP.
*/
unsigned int hdcp_content_type;
/**
* @scaling_mode: Connector property to control the
* upscaling, mostly used for built-in panels.
*/
unsigned int scaling_mode;
/**
* @content_protection: Connector property to request content
* protection. This is most commonly used for HDCP.
*/
unsigned int content_protection;
/**
* @colorspace: State variable for Connector property to request
* colorspace change on Sink. This is most commonly used to switch
* to wider color gamuts like BT2020.
*/
enum drm_colorspace colorspace;
/**
* @writeback_job: Writeback job for writeback connectors
*