hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/drm/drm_connector.h
....@@ -28,6 +28,7 @@
2828 #include <linux/ctype.h>
2929 #include <linux/hdmi.h>
3030 #include <drm/drm_mode_object.h>
31
+#include <drm/drm_util.h>
3132
3233 #include <uapi/drm/drm_mode.h>
3334
....@@ -39,8 +40,8 @@
3940 struct drm_property;
4041 struct drm_property_blob;
4142 struct drm_printer;
42
-struct drm_panel;
4343 struct edid;
44
+struct i2c_adapter;
4445
4546 enum drm_connector_force {
4647 DRM_FORCE_UNSPECIFIED,
....@@ -174,6 +175,7 @@
174175 struct drm_scrambling scrambling;
175176 };
176177
178
+#ifdef CONFIG_NO_GKI
177179 /**
178180 * struct drm_hdmi_dsc_cap - DSC capabilities of HDMI sink
179181 *
....@@ -214,6 +216,7 @@
214216 /** @total_chunk_kbytes: max size of chunks in KBs supported per line*/
215217 u8 total_chunk_kbytes;
216218 };
219
+#endif
217220
218221 /**
219222 * struct drm_hdmi_info - runtime information about the connected HDMI sink
....@@ -227,19 +230,19 @@
227230
228231 /**
229232 * @y420_vdb_modes: bitmap of modes which can support ycbcr420
230
- * output only (not normal RGB/YCBCR444/422 outputs). There are total
231
- * 107 VICs defined by CEA-861-F spec, so the size is 128 bits to map
232
- * upto 128 VICs;
233
+ * output only (not normal RGB/YCBCR444/422 outputs). The max VIC
234
+ * defined by the CEA-861-G spec is 219, so the size is 256 bits to map
235
+ * up to 256 VICs.
233236 */
234
- unsigned long y420_vdb_modes[BITS_TO_LONGS(128)];
237
+ unsigned long y420_vdb_modes[BITS_TO_LONGS(256)];
235238
236239 /**
237240 * @y420_cmdb_modes: bitmap of modes which can support ycbcr420
238
- * output also, along with normal HDMI outputs. There are total 107
239
- * VICs defined by CEA-861-F spec, so the size is 128 bits to map upto
240
- * 128 VICs;
241
+ * output also, along with normal HDMI outputs. The max VIC defined by
242
+ * the CEA-861-G spec is 219, so the size is 256 bits to map up to 256
243
+ * VICs.
241244 */
242
- unsigned long y420_cmdb_modes[BITS_TO_LONGS(128)];
245
+ unsigned long y420_cmdb_modes[BITS_TO_LONGS(256)];
243246
244247 /** @y420_cmdb_map: bitmap of SVD index, to extraxt vcb modes */
245248 u64 y420_cmdb_map;
....@@ -247,9 +250,7 @@
247250 /** @y420_dc_modes: bitmap of deep color support index */
248251 u8 y420_dc_modes;
249252
250
- /* @colorimetry: bitmap of supported colorimetry modes */
251
- u16 colorimetry;
252
-
253
+#ifdef CONFIG_NO_GKI
253254 /** @max_frl_rate_per_lane: support fixed rate link */
254255 u8 max_frl_rate_per_lane;
255256
....@@ -258,6 +259,7 @@
258259
259260 /** @dsc_cap: DSC capabilities of the sink */
260261 struct drm_hdmi_dsc_cap dsc_cap;
262
+#endif
261263 };
262264
263265 /**
....@@ -305,6 +307,23 @@
305307 DRM_MODE_PANEL_ORIENTATION_RIGHT_UP,
306308 };
307309
310
+/**
311
+ * struct drm_monitor_range_info - Panel's Monitor range in EDID for
312
+ * &drm_display_info
313
+ *
314
+ * This struct is used to store a frequency range supported by panel
315
+ * as parsed from EDID's detailed monitor range descriptor block.
316
+ *
317
+ * @min_vfreq: This is the min supported refresh rate in Hz from
318
+ * EDID's detailed monitor range.
319
+ * @max_vfreq: This is the max supported refresh rate in Hz from
320
+ * EDID's detailed monitor range
321
+ */
322
+struct drm_monitor_range_info {
323
+ u8 min_vfreq;
324
+ u8 max_vfreq;
325
+};
326
+
308327 /*
309328 * This is a consolidated colorimetry list supported by HDMI and
310329 * DP protocol standard. The respective connectors will register
....@@ -332,12 +351,121 @@
332351 /* Additional Colorimetry extension added as part of CTA 861.G */
333352 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_D65 11
334353 #define DRM_MODE_COLORIMETRY_DCI_P3_RGB_THEATER 12
335
-/* DP MSA Colorimetry Options */
336
-#define DRM_MODE_DP_COLORIMETRY_BT601_YCC 13
337
-#define DRM_MODE_DP_COLORIMETRY_BT709_YCC 14
338
-#define DRM_MODE_DP_COLORIMETRY_SRGB 15
339
-#define DRM_MODE_DP_COLORIMETRY_RGB_WIDE_GAMUT 16
340
-#define DRM_MODE_DP_COLORIMETRY_SCRGB 17
354
+/* Additional Colorimetry Options added for DP 1.4a VSC Colorimetry Format */
355
+#define DRM_MODE_COLORIMETRY_RGB_WIDE_FIXED 13
356
+#define DRM_MODE_COLORIMETRY_RGB_WIDE_FLOAT 14
357
+#define DRM_MODE_COLORIMETRY_BT601_YCC 15
358
+
359
+/**
360
+ * enum drm_bus_flags - bus_flags info for &drm_display_info
361
+ *
362
+ * This enum defines signal polarities and clock edge information for signals on
363
+ * a bus as bitmask flags.
364
+ *
365
+ * The clock edge information is conveyed by two sets of symbols,
366
+ * DRM_BUS_FLAGS_*_DRIVE_\* and DRM_BUS_FLAGS_*_SAMPLE_\*. When this enum is
367
+ * used to describe a bus from the point of view of the transmitter, the
368
+ * \*_DRIVE_\* flags should be used. When used from the point of view of the
369
+ * receiver, the \*_SAMPLE_\* flags should be used. The \*_DRIVE_\* and
370
+ * \*_SAMPLE_\* flags alias each other, with the \*_SAMPLE_POSEDGE and
371
+ * \*_SAMPLE_NEGEDGE flags being equal to \*_DRIVE_NEGEDGE and \*_DRIVE_POSEDGE
372
+ * respectively. This simplifies code as signals are usually sampled on the
373
+ * opposite edge of the driving edge. Transmitters and receivers may however
374
+ * need to take other signal timings into account to convert between driving
375
+ * and sample edges.
376
+ */
377
+enum drm_bus_flags {
378
+ /**
379
+ * @DRM_BUS_FLAG_DE_LOW:
380
+ *
381
+ * The Data Enable signal is active low
382
+ */
383
+ DRM_BUS_FLAG_DE_LOW = BIT(0),
384
+
385
+ /**
386
+ * @DRM_BUS_FLAG_DE_HIGH:
387
+ *
388
+ * The Data Enable signal is active high
389
+ */
390
+ DRM_BUS_FLAG_DE_HIGH = BIT(1),
391
+
392
+ /**
393
+ * @DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE:
394
+ *
395
+ * Data is driven on the rising edge of the pixel clock
396
+ */
397
+ DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE = BIT(2),
398
+
399
+ /**
400
+ * @DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE:
401
+ *
402
+ * Data is driven on the falling edge of the pixel clock
403
+ */
404
+ DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE = BIT(3),
405
+
406
+ /**
407
+ * @DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE:
408
+ *
409
+ * Data is sampled on the rising edge of the pixel clock
410
+ */
411
+ DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE = DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
412
+
413
+ /**
414
+ * @DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE:
415
+ *
416
+ * Data is sampled on the falling edge of the pixel clock
417
+ */
418
+ DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE = DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE,
419
+
420
+ /**
421
+ * @DRM_BUS_FLAG_DATA_MSB_TO_LSB:
422
+ *
423
+ * Data is transmitted MSB to LSB on the bus
424
+ */
425
+ DRM_BUS_FLAG_DATA_MSB_TO_LSB = BIT(4),
426
+
427
+ /**
428
+ * @DRM_BUS_FLAG_DATA_LSB_TO_MSB:
429
+ *
430
+ * Data is transmitted LSB to MSB on the bus
431
+ */
432
+ DRM_BUS_FLAG_DATA_LSB_TO_MSB = BIT(5),
433
+
434
+ /**
435
+ * @DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE:
436
+ *
437
+ * Sync signals are driven on the rising edge of the pixel clock
438
+ */
439
+ DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE = BIT(6),
440
+
441
+ /**
442
+ * @DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE:
443
+ *
444
+ * Sync signals are driven on the falling edge of the pixel clock
445
+ */
446
+ DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE = BIT(7),
447
+
448
+ /**
449
+ * @DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE:
450
+ *
451
+ * Sync signals are sampled on the rising edge of the pixel clock
452
+ */
453
+ DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE = DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE,
454
+
455
+ /**
456
+ * @DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE:
457
+ *
458
+ * Sync signals are sampled on the falling edge of the pixel clock
459
+ */
460
+ DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE = DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE,
461
+
462
+ /**
463
+ * @DRM_BUS_FLAG_SHARP_SIGNALS:
464
+ *
465
+ * Set if the Sharp-specific signals (SPL, CLS, PS, REV) must be used
466
+ */
467
+ DRM_BUS_FLAG_SHARP_SIGNALS = BIT(8),
468
+};
341469
342470 /**
343471 * struct drm_display_info - runtime data about the connected sink
....@@ -352,25 +480,15 @@
352480 */
353481 struct drm_display_info {
354482 /**
355
- * @name: Name of the display.
356
- */
357
- char name[DRM_DISPLAY_INFO_LEN];
358
-
359
- /**
360483 * @width_mm: Physical width in mm.
361484 */
362
- unsigned int width_mm;
485
+ unsigned int width_mm;
486
+
363487 /**
364488 * @height_mm: Physical height in mm.
365489 */
366490 unsigned int height_mm;
367491
368
- /**
369
- * @pixel_clock: Maximum pixel clock supported by the sink, in units of
370
- * 100Hz. This mismatches the clock in &drm_display_mode (which is in
371
- * kHZ), because that's what the EDID uses as base unit.
372
- */
373
- unsigned int pixel_clock;
374492 /**
375493 * @bpc: Maximum bits per color channel. Used by HDMI and DP outputs.
376494 */
....@@ -414,52 +532,10 @@
414532 */
415533 unsigned int num_bus_formats;
416534
417
-#define DRM_BUS_FLAG_DE_LOW (1<<0)
418
-#define DRM_BUS_FLAG_DE_HIGH (1<<1)
419
-
420
-/*
421
- * Don't use those two flags directly, use the DRM_BUS_FLAG_PIXDATA_DRIVE_*
422
- * and DRM_BUS_FLAG_PIXDATA_SAMPLE_* variants to qualify the flags explicitly.
423
- * The DRM_BUS_FLAG_PIXDATA_SAMPLE_* flags are defined as the opposite of the
424
- * DRM_BUS_FLAG_PIXDATA_DRIVE_* flags to make code simpler, as signals are
425
- * usually to be sampled on the opposite edge of the driving edge.
426
- */
427
-#define DRM_BUS_FLAG_PIXDATA_POSEDGE (1<<2)
428
-#define DRM_BUS_FLAG_PIXDATA_NEGEDGE (1<<3)
429
-
430
-/* Drive data on rising edge */
431
-#define DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE DRM_BUS_FLAG_PIXDATA_POSEDGE
432
-/* Drive data on falling edge */
433
-#define DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE DRM_BUS_FLAG_PIXDATA_NEGEDGE
434
-/* Sample data on rising edge */
435
-#define DRM_BUS_FLAG_PIXDATA_SAMPLE_POSEDGE DRM_BUS_FLAG_PIXDATA_NEGEDGE
436
-/* Sample data on falling edge */
437
-#define DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE DRM_BUS_FLAG_PIXDATA_POSEDGE
438
-
439
-/* data is transmitted MSB to LSB on the bus */
440
-#define DRM_BUS_FLAG_DATA_MSB_TO_LSB (1<<4)
441
-/* data is transmitted LSB to MSB on the bus */
442
-#define DRM_BUS_FLAG_DATA_LSB_TO_MSB (1<<5)
443
-
444
-/*
445
- * Similarly to the DRM_BUS_FLAG_PIXDATA_* flags, don't use these two flags
446
- * directly, use one of the DRM_BUS_FLAG_SYNC_(DRIVE|SAMPLE)_* instead.
447
- */
448
-#define DRM_BUS_FLAG_SYNC_POSEDGE (1<<6)
449
-#define DRM_BUS_FLAG_SYNC_NEGEDGE (1<<7)
450
-
451
-/* Drive sync on rising edge */
452
-#define DRM_BUS_FLAG_SYNC_DRIVE_POSEDGE DRM_BUS_FLAG_SYNC_POSEDGE
453
-/* Drive sync on falling edge */
454
-#define DRM_BUS_FLAG_SYNC_DRIVE_NEGEDGE DRM_BUS_FLAG_SYNC_NEGEDGE
455
-/* Sample sync on rising edge */
456
-#define DRM_BUS_FLAG_SYNC_SAMPLE_POSEDGE DRM_BUS_FLAG_SYNC_NEGEDGE
457
-/* Sample sync on falling edge */
458
-#define DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE DRM_BUS_FLAG_SYNC_POSEDGE
459
-
460535 /**
461536 * @bus_flags: Additional information (like pixel signal polarity) for
462
- * the pixel data on the bus, using DRM_BUS_FLAGS\_ defines.
537
+ * the pixel data on the bus, using &enum drm_bus_flags values
538
+ * DRM_BUS_FLAGS\_.
463539 */
464540 u32 bus_flags;
465541
....@@ -475,9 +551,23 @@
475551 bool dvi_dual;
476552
477553 /**
554
+ * @is_hdmi: True if the sink is an HDMI device.
555
+ *
556
+ * This field shall be used instead of calling
557
+ * drm_detect_hdmi_monitor() when possible.
558
+ */
559
+ bool is_hdmi;
560
+
561
+ /**
478562 * @has_hdmi_infoframe: Does the sink support the HDMI infoframe?
479563 */
480564 bool has_hdmi_infoframe;
565
+
566
+ /**
567
+ * @rgb_quant_range_selectable: Does the sink support selecting
568
+ * the RGB quantization range?
569
+ */
570
+ bool rgb_quant_range_selectable;
481571
482572 /**
483573 * @edid_hdmi_dc_modes: Mask of supported hdmi deep color modes. Even
....@@ -499,6 +589,11 @@
499589 * @non_desktop: Non desktop display (HMD).
500590 */
501591 bool non_desktop;
592
+
593
+ /**
594
+ * @monitor_range: Frequency range supported by monitor range descriptor
595
+ */
596
+ struct drm_monitor_range_info monitor_range;
502597 };
503598
504599 int drm_display_info_set_bus_formats(struct drm_display_info *info,
....@@ -506,13 +601,37 @@
506601 unsigned int num_formats);
507602
508603 /**
604
+ * struct drm_connector_tv_margins - TV connector related margins
605
+ *
606
+ * Describes the margins in pixels to put around the image on TV
607
+ * connectors to deal with overscan.
608
+ */
609
+struct drm_connector_tv_margins {
610
+ /**
611
+ * @bottom: Bottom margin in pixels.
612
+ */
613
+ unsigned int bottom;
614
+
615
+ /**
616
+ * @left: Left margin in pixels.
617
+ */
618
+ unsigned int left;
619
+
620
+ /**
621
+ * @right: Right margin in pixels.
622
+ */
623
+ unsigned int right;
624
+
625
+ /**
626
+ * @top: Top margin in pixels.
627
+ */
628
+ unsigned int top;
629
+};
630
+
631
+/**
509632 * struct drm_tv_connector_state - TV connector related states
510633 * @subconnector: selected subconnector
511
- * @margins: margins
512
- * @margins.left: left margin
513
- * @margins.right: right margin
514
- * @margins.top: top margin
515
- * @margins.bottom: bottom margin
634
+ * @margins: TV margins
516635 * @mode: TV mode
517636 * @brightness: brightness in percent
518637 * @contrast: contrast in percent
....@@ -523,12 +642,7 @@
523642 */
524643 struct drm_tv_connector_state {
525644 enum drm_mode_subconnector subconnector;
526
- struct {
527
- unsigned int left;
528
- unsigned int right;
529
- unsigned int top;
530
- unsigned int bottom;
531
- } margins;
645
+ struct drm_connector_tv_margins margins;
532646 unsigned int mode;
533647 unsigned int brightness;
534648 unsigned int contrast;
....@@ -559,6 +673,15 @@
559673 * Used by the atomic helpers to select the encoder, through the
560674 * &drm_connector_helper_funcs.atomic_best_encoder or
561675 * &drm_connector_helper_funcs.best_encoder callbacks.
676
+ *
677
+ * This is also used in the atomic helpers to map encoders to their
678
+ * current and previous connectors, see
679
+ * drm_atomic_get_old_connector_for_encoder() and
680
+ * drm_atomic_get_new_connector_for_encoder().
681
+ *
682
+ * NOTE: Atomic drivers must fill this out (either themselves or through
683
+ * helpers), for otherwise the GETCONNECTOR and GETENCODER IOCTLs will
684
+ * not return correct data to userspace.
562685 */
563686 struct drm_encoder *best_encoder;
564687
....@@ -582,6 +705,20 @@
582705 struct drm_tv_connector_state tv;
583706
584707 /**
708
+ * @self_refresh_aware:
709
+ *
710
+ * This tracks whether a connector is aware of the self refresh state.
711
+ * It should be set to true for those connector implementations which
712
+ * understand the self refresh state. This is needed since the crtc
713
+ * registers the self refresh helpers and it doesn't know if the
714
+ * connectors downstream have implemented self refresh entry/exit.
715
+ *
716
+ * Drivers should set this to true in atomic_check if they know how to
717
+ * handle self_refresh requests.
718
+ */
719
+ bool self_refresh_aware;
720
+
721
+ /**
585722 * @picture_aspect_ratio: Connector property to control the
586723 * HDMI infoframe aspect ratio setting.
587724 *
....@@ -597,6 +734,12 @@
597734 * match the values.
598735 */
599736 unsigned int content_type;
737
+
738
+ /**
739
+ * @hdcp_content_type: Connector property to pass the type of
740
+ * protected content. This is most commonly used for HDCP.
741
+ */
742
+ unsigned int hdcp_content_type;
600743
601744 /**
602745 * @scaling_mode: Connector property to control the
....@@ -631,12 +774,22 @@
631774 struct drm_writeback_job *writeback_job;
632775
633776 /**
777
+ * @max_requested_bpc: Connector property to limit the maximum bit
778
+ * depth of the pixels.
779
+ */
780
+ u8 max_requested_bpc;
781
+
782
+ /**
783
+ * @max_bpc: Connector max_bpc based on the requested max_bpc property
784
+ * and the connector bpc limitations obtained from edid.
785
+ */
786
+ u8 max_bpc;
787
+
788
+ /**
634789 * @hdr_output_metadata:
635790 * DRM blob property for HDR output metadata
636791 */
637792 struct drm_property_blob *hdr_output_metadata;
638
-
639
- struct drm_property_blob *hdr_panel_blob_ptr;
640793 };
641794
642795 /**
....@@ -932,19 +1085,131 @@
9321085 const struct drm_connector_state *state);
9331086 };
9341087
935
-/* mode specified on the command line */
1088
+/**
1089
+ * struct drm_cmdline_mode - DRM Mode passed through the kernel command-line
1090
+ *
1091
+ * Each connector can have an initial mode with additional options
1092
+ * passed through the kernel command line. This structure allows to
1093
+ * express those parameters and will be filled by the command-line
1094
+ * parser.
1095
+ */
9361096 struct drm_cmdline_mode {
1097
+ /**
1098
+ * @name:
1099
+ *
1100
+ * Name of the mode.
1101
+ */
1102
+ char name[DRM_DISPLAY_MODE_LEN];
1103
+
1104
+ /**
1105
+ * @specified:
1106
+ *
1107
+ * Has a mode been read from the command-line?
1108
+ */
9371109 bool specified;
1110
+
1111
+ /**
1112
+ * @refresh_specified:
1113
+ *
1114
+ * Did the mode have a preferred refresh rate?
1115
+ */
9381116 bool refresh_specified;
1117
+
1118
+ /**
1119
+ * @bpp_specified:
1120
+ *
1121
+ * Did the mode have a preferred BPP?
1122
+ */
9391123 bool bpp_specified;
940
- int xres, yres;
1124
+
1125
+ /**
1126
+ * @xres:
1127
+ *
1128
+ * Active resolution on the X axis, in pixels.
1129
+ */
1130
+ int xres;
1131
+
1132
+ /**
1133
+ * @yres:
1134
+ *
1135
+ * Active resolution on the Y axis, in pixels.
1136
+ */
1137
+ int yres;
1138
+
1139
+ /**
1140
+ * @bpp:
1141
+ *
1142
+ * Bits per pixels for the mode.
1143
+ */
9411144 int bpp;
1145
+
1146
+ /**
1147
+ * @refresh:
1148
+ *
1149
+ * Refresh rate, in Hertz.
1150
+ */
9421151 int refresh;
1152
+
1153
+ /**
1154
+ * @rb:
1155
+ *
1156
+ * Do we need to use reduced blanking?
1157
+ */
9431158 bool rb;
1159
+
1160
+ /**
1161
+ * @interlace:
1162
+ *
1163
+ * The mode is interlaced.
1164
+ */
9441165 bool interlace;
1166
+
1167
+ /**
1168
+ * @cvt:
1169
+ *
1170
+ * The timings will be calculated using the VESA Coordinated
1171
+ * Video Timings instead of looking up the mode from a table.
1172
+ */
9451173 bool cvt;
1174
+
1175
+ /**
1176
+ * @margins:
1177
+ *
1178
+ * Add margins to the mode calculation (1.8% of xres rounded
1179
+ * down to 8 pixels and 1.8% of yres).
1180
+ */
9461181 bool margins;
1182
+
1183
+ /**
1184
+ * @force:
1185
+ *
1186
+ * Ignore the hotplug state of the connector, and force its
1187
+ * state to one of the DRM_FORCE_* values.
1188
+ */
9471189 enum drm_connector_force force;
1190
+
1191
+ /**
1192
+ * @rotation_reflection:
1193
+ *
1194
+ * Initial rotation and reflection of the mode setup from the
1195
+ * command line. See DRM_MODE_ROTATE_* and
1196
+ * DRM_MODE_REFLECT_*. The only rotations supported are
1197
+ * DRM_MODE_ROTATE_0 and DRM_MODE_ROTATE_180.
1198
+ */
1199
+ unsigned int rotation_reflection;
1200
+
1201
+ /**
1202
+ * @panel_orientation:
1203
+ *
1204
+ * drm-connector "panel orientation" property override value,
1205
+ * DRM_MODE_PANEL_ORIENTATION_UNKNOWN if not set.
1206
+ */
1207
+ enum drm_panel_orientation panel_orientation;
1208
+
1209
+ /**
1210
+ * @tv_margins: TV margins to apply to the mode.
1211
+ */
1212
+ struct drm_connector_tv_margins tv_margins;
9481213 };
9491214
9501215 /**
....@@ -1023,7 +1288,7 @@
10231288 /**
10241289 * @ycbcr_420_allowed : This bool indicates if this connector is
10251290 * capable of handling YCBCR 420 output. While parsing the EDID
1026
- * blocks, its very helpful to know, if the source is capable of
1291
+ * blocks it's very helpful to know if the source is capable of
10271292 * handling YCBCR 420 outputs.
10281293 */
10291294 bool ycbcr_420_allowed;
....@@ -1089,10 +1354,15 @@
10891354 struct drm_property *scaling_mode_property;
10901355
10911356 /**
1092
- * @content_protection_property: DRM ENUM property for content
1093
- * protection. See drm_connector_attach_content_protection_property().
1357
+ * @vrr_capable_property: Optional property to help userspace
1358
+ * query hardware support for variable refresh rate on a connector.
1359
+ * connector. Drivers can add the property to a connector by
1360
+ * calling drm_connector_attach_vrr_capable_property().
1361
+ *
1362
+ * This should be updated only by calling
1363
+ * drm_connector_set_vrr_capable_property().
10941364 */
1095
- struct drm_property *content_protection_property;
1365
+ struct drm_property *vrr_capable_property;
10961366
10971367 /**
10981368 * @colorspace_property: Connector property to set the suitable
....@@ -1107,6 +1377,12 @@
11071377 * be updated by calling drm_connector_set_path_property().
11081378 */
11091379 struct drm_property_blob *path_blob_ptr;
1380
+
1381
+ /**
1382
+ * @max_bpc_property: Default connector property for the max bpc to be
1383
+ * driven out of the connector.
1384
+ */
1385
+ struct drm_property *max_bpc_property;
11101386
11111387 #define DRM_CONNECTOR_POLL_HPD (1 << 0)
11121388 #define DRM_CONNECTOR_POLL_CONNECT (1 << 1)
....@@ -1152,13 +1428,15 @@
11521428 enum drm_connector_force force;
11531429 /** @override_edid: has the EDID been overwritten through debugfs for testing? */
11541430 bool override_edid;
1431
+ /** @epoch_counter: used to detect any other changes in connector, besides status */
1432
+ u64 epoch_counter;
11551433
1156
-#define DRM_CONNECTOR_MAX_ENCODER 3
11571434 /**
1158
- * @encoder_ids: Valid encoders for this connector. Please only use
1159
- * drm_connector_for_each_possible_encoder() to enumerate these.
1435
+ * @possible_encoders: Bit mask of encoders that can drive this
1436
+ * connector, drm_encoder_index() determines the index into the bitfield
1437
+ * and the bits are set with drm_connector_attach_encoder().
11601438 */
1161
- uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
1439
+ u32 possible_encoders;
11621440
11631441 /**
11641442 * @encoder: Currently bound encoder driving this connector, if any.
....@@ -1167,11 +1445,6 @@
11671445 * need the CRTC driving this output, &drm_connector_state.crtc.
11681446 */
11691447 struct drm_encoder *encoder;
1170
- /**
1171
- * @loader_protect:
1172
- * connector loader logo protect state.
1173
- */
1174
- bool loader_protect;
11751448
11761449 #define MAX_ELD_BYTES 128
11771450 /** @eld: EDID-like data, if present */
....@@ -1188,6 +1461,18 @@
11881461 * [0]: progressive, [1]: interlaced
11891462 */
11901463 int audio_latency[2];
1464
+
1465
+ /**
1466
+ * @ddc: associated ddc adapter.
1467
+ * A connector usually has its associated ddc adapter. If a driver uses
1468
+ * this field, then an appropriate symbolic link is created in connector
1469
+ * sysfs directory to make it easy for the user to tell which i2c
1470
+ * adapter is for a particular display.
1471
+ *
1472
+ * The field should be set by calling drm_connector_init_with_ddc().
1473
+ */
1474
+ struct i2c_adapter *ddc;
1475
+
11911476 /**
11921477 * @null_edid_counter: track sinks that give us all zeros for the EDID.
11931478 * Needed to workaround some HW bugs where we get all 0s
....@@ -1197,60 +1482,18 @@
11971482 /** @bad_edid_counter: track sinks that give us an EDID with invalid checksum */
11981483 unsigned bad_edid_counter;
11991484
1200
- /*
1201
- * @pt_scan_info: PT scan info obtained from the VCDB of EDID
1202
- * @it_scan_info: IT scan info obtained from the VCDB of EDID
1203
- * @ce_scan_info: CE scan info obtained from the VCDB of EDID
1204
- * @color_enc_fmt: Colorimetry encoding formats of sink
1205
- * @hdr_eotf: Electro optical transfer function obtained from HDR block
1206
- * @hdr_metadata_type_one: Metadata type one obtained from HDR block
1207
- * @hdr_max_luminance: desired max luminance obtained from HDR block
1208
- * @hdr_avg_luminance: desired avg luminance obtained from HDR block
1209
- * @hdr_min_luminance: desired min luminance obtained from HDR block
1210
- * @hdr_supported: does the sink support HDR content
1211
- * @max_tmds_char: indicates the maximum TMDS Character Rate supported
1212
- * @scdc_present: when set the sink supports SCDC functionality
1213
- * @rr_capable: when set the sink is capable of initiating an
1214
- * SCDC read request
1215
- * @supports_scramble: when set the sink supports less than
1216
- * 340Mcsc scrambling
1217
- * @flags_3d: 3D view(s) supported by the sink, see drm_edid.h
1218
- * DRM_EDID_3D_*)
1219
- */
1220
- u8 pt_scan_info;
1221
- u8 it_scan_info;
1222
- u8 ce_scan_info;
1223
- u32 color_enc_fmt;
1224
- u32 hdr_eotf;
1225
- bool hdr_metadata_type_one;
1226
- u32 hdr_max_luminance;
1227
- u32 hdr_avg_luminance;
1228
- u32 hdr_min_luminance;
1229
- bool hdr_supported;
1230
- u8 hdr_plus_app_ver;
1231
-
1232
- /* EDID bits HDMI 2.0
1233
- * @max_tmds_char: indicates the maximum TMDS Character Rate supported
1234
- * @scdc_present: when set the sink supports SCDC functionality
1235
- * @rr_capable: when set the sink is capable of initiating an
1236
- * SCDC read request
1237
- * @supports_scramble: when set the sink supports less than
1238
- * 340Mcsc scrambling
1239
- * @flags_3d: 3D view(s) supported by the sink, see drm_edid.h
1240
- * (DRM_EDID_3D_*)
1241
- */
1242
- int max_tmds_char; /* in Mcsc */
1243
- bool scdc_present;
1244
- bool rr_capable;
1245
- bool supports_scramble;
1246
- int flags_3d;
1247
-
12481485 /**
12491486 * @edid_corrupt: Indicates whether the last read EDID was corrupt. Used
12501487 * in Displayport compliance testing - Displayport Link CTS Core 1.2
12511488 * rev1.1 4.2.2.6
12521489 */
12531490 bool edid_corrupt;
1491
+ /**
1492
+ * @real_edid_checksum: real edid checksum for corrupted edid block.
1493
+ * Required in Displayport 1.4 compliance testing
1494
+ * rev1.1 4.2.2.6
1495
+ */
1496
+ u8 real_edid_checksum;
12541497
12551498 /** @debugfs_entry: debugfs directory for this connector */
12561499 struct dentry *debugfs_entry;
....@@ -1314,21 +1557,8 @@
13141557 */
13151558 struct llist_node free_node;
13161559
1560
+ /** @hdr_sink_metadata: HDR Metadata Information read from sink */
13171561 struct hdr_sink_metadata hdr_sink_metadata;
1318
-
1319
- /**
1320
- * @panel:
1321
- *
1322
- * Can find the panel which connected to drm_connector.
1323
- */
1324
- struct drm_panel *panel;
1325
-
1326
- /**
1327
- * @checksum:
1328
- *
1329
- * The calculated checksum value of first 127 bytes of associated EDID.
1330
- */
1331
- u8 checksum;
13321562 };
13331563
13341564 #define obj_to_connector(x) container_of(x, struct drm_connector, base)
....@@ -1337,6 +1567,11 @@
13371567 struct drm_connector *connector,
13381568 const struct drm_connector_funcs *funcs,
13391569 int connector_type);
1570
+int drm_connector_init_with_ddc(struct drm_device *dev,
1571
+ struct drm_connector *connector,
1572
+ const struct drm_connector_funcs *funcs,
1573
+ int connector_type,
1574
+ struct i2c_adapter *ddc);
13401575 void drm_connector_attach_edid_property(struct drm_connector *connector);
13411576 int drm_connector_register(struct drm_connector *connector);
13421577 void drm_connector_unregister(struct drm_connector *connector);
....@@ -1397,30 +1632,6 @@
13971632 }
13981633
13991634 /**
1400
- * drm_connector_reference - acquire a connector reference
1401
- * @connector: DRM connector
1402
- *
1403
- * This is a compatibility alias for drm_connector_get() and should not be
1404
- * used by new code.
1405
- */
1406
-static inline void drm_connector_reference(struct drm_connector *connector)
1407
-{
1408
- drm_connector_get(connector);
1409
-}
1410
-
1411
-/**
1412
- * drm_connector_unreference - release a connector reference
1413
- * @connector: DRM connector
1414
- *
1415
- * This is a compatibility alias for drm_connector_put() and should not be
1416
- * used by new code.
1417
- */
1418
-static inline void drm_connector_unreference(struct drm_connector *connector)
1419
-{
1420
- drm_connector_put(connector);
1421
-}
1422
-
1423
-/**
14241635 * drm_connector_is_unregistered - has the connector been unregistered from
14251636 * userspace?
14261637 * @connector: DRM connector
....@@ -1438,6 +1649,8 @@
14381649 DRM_CONNECTOR_UNREGISTERED;
14391650 }
14401651
1652
+void drm_connector_oob_hotplug_event(struct fwnode_handle *connector_fwnode);
1653
+const char *drm_get_connector_type_name(unsigned int connector_type);
14411654 const char *drm_get_connector_status_name(enum drm_connector_status status);
14421655 const char *drm_get_subpixel_order_name(enum subpixel_order order);
14431656 const char *drm_get_dpms_name(int val);
....@@ -1445,21 +1658,27 @@
14451658 const char *drm_get_dvi_i_select_name(int val);
14461659 const char *drm_get_tv_subconnector_name(int val);
14471660 const char *drm_get_tv_select_name(int val);
1661
+const char *drm_get_dp_subconnector_name(int val);
14481662 const char *drm_get_content_protection_name(int val);
1449
-const char *drm_get_connector_name(int val);
1663
+const char *drm_get_hdcp_content_type_name(int val);
14501664
14511665 int drm_mode_create_dvi_i_properties(struct drm_device *dev);
1666
+void drm_connector_attach_dp_subconnector_property(struct drm_connector *connector);
1667
+
1668
+int drm_mode_create_tv_margin_properties(struct drm_device *dev);
14521669 int drm_mode_create_tv_properties(struct drm_device *dev,
14531670 unsigned int num_modes,
14541671 const char * const modes[]);
1672
+void drm_connector_attach_tv_margin_properties(struct drm_connector *conn);
14551673 int drm_mode_create_scaling_mode_property(struct drm_device *dev);
14561674 int drm_connector_attach_content_type_property(struct drm_connector *dev);
14571675 int drm_connector_attach_scaling_mode_property(struct drm_connector *connector,
14581676 u32 scaling_mode_mask);
1459
-int drm_connector_attach_content_protection_property(
1677
+int drm_connector_attach_vrr_capable_property(
14601678 struct drm_connector *connector);
14611679 int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
1462
-int drm_mode_create_colorspace_property(struct drm_connector *connector);
1680
+int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector);
1681
+int drm_mode_create_dp_colorspace_property(struct drm_connector *connector);
14631682 int drm_mode_create_content_type_property(struct drm_device *dev);
14641683 void drm_hdmi_avi_infoframe_content_type(struct hdmi_avi_infoframe *frame,
14651684 const struct drm_connector_state *conn_state);
....@@ -1473,8 +1692,17 @@
14731692 const struct edid *edid);
14741693 void drm_connector_set_link_status_property(struct drm_connector *connector,
14751694 uint64_t link_status);
1476
-int drm_connector_init_panel_orientation_property(
1477
- struct drm_connector *connector, int width, int height);
1695
+void drm_connector_set_vrr_capable_property(
1696
+ struct drm_connector *connector, bool capable);
1697
+int drm_connector_set_panel_orientation(
1698
+ struct drm_connector *connector,
1699
+ enum drm_panel_orientation panel_orientation);
1700
+int drm_connector_set_panel_orientation_with_quirk(
1701
+ struct drm_connector *connector,
1702
+ enum drm_panel_orientation panel_orientation,
1703
+ int width, int height);
1704
+int drm_connector_attach_max_bpc_property(struct drm_connector *connector,
1705
+ int min, int max);
14781706
14791707 /**
14801708 * struct drm_tile_group - Tile group metadata
....@@ -1494,9 +1722,9 @@
14941722 };
14951723
14961724 struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
1497
- char topology[8]);
1725
+ const char topology[8]);
14981726 struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
1499
- char topology[8]);
1727
+ const char topology[8]);
15001728 void drm_mode_put_tile_group(struct drm_device *dev,
15011729 struct drm_tile_group *tg);
15021730
....@@ -1540,13 +1768,9 @@
15401768 * drm_connector_for_each_possible_encoder - iterate connector's possible encoders
15411769 * @connector: &struct drm_connector pointer
15421770 * @encoder: &struct drm_encoder pointer used as cursor
1543
- * @__i: int iteration cursor, for macro-internal use
15441771 */
1545
-#define drm_connector_for_each_possible_encoder(connector, encoder, __i) \
1546
- for ((__i) = 0; (__i) < ARRAY_SIZE((connector)->encoder_ids) && \
1547
- (connector)->encoder_ids[(__i)] != 0; (__i)++) \
1548
- for_each_if((encoder) = \
1549
- drm_encoder_find((connector)->dev, NULL, \
1550
- (connector)->encoder_ids[(__i)])) \
1772
+#define drm_connector_for_each_possible_encoder(connector, encoder) \
1773
+ drm_for_each_encoder_mask(encoder, (connector)->dev, \
1774
+ (connector)->possible_encoders)
15511775
15521776 #endif