@@ -1979,7 +1979,7 @@ bool drm_edid_block_valid(u8 *_block, int block_num, bool print_bad_edid,
1979
1979
1980
1980
status = edid_block_check (block , is_base_block );
1981
1981
if (status == EDID_BLOCK_HEADER_REPAIR ) {
1982
- DRM_DEBUG ("Fixing EDID header, your hardware may be failing\n" );
1982
+ DRM_DEBUG_KMS ("Fixing EDID header, your hardware may be failing\n" );
1983
1983
edid_header_fix (block );
1984
1984
1985
1985
/* Retry with fixed header, update status if that worked. */
@@ -2301,8 +2301,9 @@ int drm_edid_override_connector_update(struct drm_connector *connector)
2301
2301
2302
2302
drm_edid_free (override );
2303
2303
2304
- DRM_DEBUG_KMS ("[CONNECTOR:%d:%s] adding %d modes via fallback override/firmware EDID\n" ,
2305
- connector -> base .id , connector -> name , num_modes );
2304
+ drm_dbg_kms (connector -> dev ,
2305
+ "[CONNECTOR:%d:%s] adding %d modes via fallback override/firmware EDID\n" ,
2306
+ connector -> base .id , connector -> name , num_modes );
2306
2307
}
2307
2308
2308
2309
return num_modes ;
@@ -3388,11 +3389,12 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
3388
3389
* timing block contains enough info for us to create and return a new struct
3389
3390
* drm_display_mode.
3390
3391
*/
3391
- static struct drm_display_mode * drm_mode_detailed (struct drm_device * dev ,
3392
+ static struct drm_display_mode * drm_mode_detailed (struct drm_connector * connector ,
3392
3393
const struct drm_edid * drm_edid ,
3393
3394
const struct detailed_timing * timing ,
3394
3395
u32 quirks )
3395
3396
{
3397
+ struct drm_device * dev = connector -> dev ;
3396
3398
struct drm_display_mode * mode ;
3397
3399
const struct detailed_pixel_timing * pt = & timing -> data .pixel_data ;
3398
3400
unsigned hactive = (pt -> hactive_hblank_hi & 0xf0 ) << 4 | pt -> hactive_lo ;
@@ -3409,17 +3411,19 @@ static struct drm_display_mode *drm_mode_detailed(struct drm_device *dev,
3409
3411
return NULL ;
3410
3412
3411
3413
if (pt -> misc & DRM_EDID_PT_STEREO ) {
3412
- DRM_DEBUG_KMS ("stereo mode not supported\n" );
3414
+ drm_dbg_kms (dev , "[CONNECTOR:%d:%s] Stereo mode not supported\n" ,
3415
+ connector -> base .id , connector -> name );
3413
3416
return NULL ;
3414
3417
}
3415
3418
if (!(pt -> misc & DRM_EDID_PT_SEPARATE_SYNC )) {
3416
- DRM_DEBUG_KMS ("composite sync not supported\n" );
3419
+ drm_dbg_kms (dev , "[CONNECTOR:%d:%s] Composite sync not supported\n" ,
3420
+ connector -> base .id , connector -> name );
3417
3421
}
3418
3422
3419
3423
/* it is incorrect if hsync/vsync width is zero */
3420
3424
if (!hsync_pulse_width || !vsync_pulse_width ) {
3421
- DRM_DEBUG_KMS ( " Incorrect Detailed timing. "
3422
- "Wrong Hsync/Vsync pulse width\n" );
3425
+ drm_dbg_kms ( dev , "[CONNECTOR:%d:%s] Incorrect Detailed timing. Wrong Hsync/Vsync pulse width\n" ,
3426
+ connector -> base . id , connector -> name );
3423
3427
return NULL ;
3424
3428
}
3425
3429
@@ -3976,7 +3980,8 @@ add_cvt_modes(struct drm_connector *connector, const struct drm_edid *drm_edid)
3976
3980
return closure .modes ;
3977
3981
}
3978
3982
3979
- static void fixup_detailed_cea_mode_clock (struct drm_display_mode * mode );
3983
+ static void fixup_detailed_cea_mode_clock (struct drm_connector * connector ,
3984
+ struct drm_display_mode * mode );
3980
3985
3981
3986
static void
3982
3987
do_detailed_mode (const struct detailed_timing * timing , void * c )
@@ -3987,7 +3992,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c)
3987
3992
if (!is_detailed_timing_descriptor (timing ))
3988
3993
return ;
3989
3994
3990
- newmode = drm_mode_detailed (closure -> connector -> dev ,
3995
+ newmode = drm_mode_detailed (closure -> connector ,
3991
3996
closure -> drm_edid , timing ,
3992
3997
closure -> quirks );
3993
3998
if (!newmode )
@@ -4001,7 +4006,7 @@ do_detailed_mode(const struct detailed_timing *timing, void *c)
4001
4006
* so fix up anything that looks like CEA/HDMI mode, but the clock
4002
4007
* is just slightly off.
4003
4008
*/
4004
- fixup_detailed_cea_mode_clock (newmode );
4009
+ fixup_detailed_cea_mode_clock (closure -> connector , newmode );
4005
4010
4006
4011
drm_mode_probed_add (closure -> connector , newmode );
4007
4012
closure -> modes ++ ;
@@ -4663,7 +4668,8 @@ static int add_hdmi_mode(struct drm_connector *connector, u8 vic)
4663
4668
struct drm_display_mode * newmode ;
4664
4669
4665
4670
if (!drm_valid_hdmi_vic (vic )) {
4666
- DRM_ERROR ("Unknown HDMI VIC: %d\n" , vic );
4671
+ drm_err (connector -> dev , "[CONNECTOR:%d:%s] Unknown HDMI VIC: %d\n" ,
4672
+ connector -> base .id , connector -> name , vic );
4667
4673
return 0 ;
4668
4674
}
4669
4675
@@ -5270,7 +5276,8 @@ static int add_cea_modes(struct drm_connector *connector,
5270
5276
return modes ;
5271
5277
}
5272
5278
5273
- static void fixup_detailed_cea_mode_clock (struct drm_display_mode * mode )
5279
+ static void fixup_detailed_cea_mode_clock (struct drm_connector * connector ,
5280
+ struct drm_display_mode * mode )
5274
5281
{
5275
5282
const struct drm_display_mode * cea_mode ;
5276
5283
int clock1 , clock2 , clock ;
@@ -5308,8 +5315,10 @@ static void fixup_detailed_cea_mode_clock(struct drm_display_mode *mode)
5308
5315
if (mode -> clock == clock )
5309
5316
return ;
5310
5317
5311
- DRM_DEBUG ("detailed mode matches %s VIC %d, adjusting clock %d -> %d\n" ,
5312
- type , vic , mode -> clock , clock );
5318
+ drm_dbg_kms (connector -> dev ,
5319
+ "[CONNECTOR:%d:%s] detailed mode matches %s VIC %d, adjusting clock %d -> %d\n" ,
5320
+ connector -> base .id , connector -> name ,
5321
+ type , vic , mode -> clock , clock );
5313
5322
mode -> clock = clock ;
5314
5323
}
5315
5324
@@ -5417,15 +5426,12 @@ drm_parse_hdmi_vsdb_audio(struct drm_connector *connector, const u8 *db)
5417
5426
if (len >= 12 )
5418
5427
connector -> audio_latency [1 ] = db [12 ];
5419
5428
5420
- DRM_DEBUG_KMS ("HDMI: latency present %d %d, "
5421
- "video latency %d %d, "
5422
- "audio latency %d %d\n" ,
5423
- connector -> latency_present [0 ],
5424
- connector -> latency_present [1 ],
5425
- connector -> video_latency [0 ],
5426
- connector -> video_latency [1 ],
5427
- connector -> audio_latency [0 ],
5428
- connector -> audio_latency [1 ]);
5429
+ drm_dbg_kms (connector -> dev ,
5430
+ "[CONNECTOR:%d:%s] HDMI: latency present %d %d, video latency %d %d, audio latency %d %d\n" ,
5431
+ connector -> base .id , connector -> name ,
5432
+ connector -> latency_present [0 ], connector -> latency_present [1 ],
5433
+ connector -> video_latency [0 ], connector -> video_latency [1 ],
5434
+ connector -> audio_latency [0 ], connector -> audio_latency [1 ]);
5429
5435
}
5430
5436
5431
5437
static void
@@ -5523,7 +5529,9 @@ static void drm_edid_to_eld(struct drm_connector *connector,
5523
5529
return ;
5524
5530
5525
5531
mnl = get_monitor_name (drm_edid , & eld [DRM_ELD_MONITOR_NAME_STRING ]);
5526
- DRM_DEBUG_KMS ("ELD monitor %s\n" , & eld [DRM_ELD_MONITOR_NAME_STRING ]);
5532
+ drm_dbg_kms (connector -> dev , "[CONNECTOR:%d:%s] ELD monitor %s\n" ,
5533
+ connector -> base .id , connector -> name ,
5534
+ & eld [DRM_ELD_MONITOR_NAME_STRING ]);
5527
5535
5528
5536
eld [DRM_ELD_CEA_EDID_VER_MNL ] = info -> cea_rev << DRM_ELD_CEA_EDID_VER_SHIFT ;
5529
5537
eld [DRM_ELD_CEA_EDID_VER_MNL ] |= mnl ;
@@ -5577,8 +5585,9 @@ static void drm_edid_to_eld(struct drm_connector *connector,
5577
5585
eld [DRM_ELD_BASELINE_ELD_LEN ] =
5578
5586
DIV_ROUND_UP (drm_eld_calc_baseline_block_size (eld ), 4 );
5579
5587
5580
- DRM_DEBUG_KMS ("ELD size %d, SAD count %d\n" ,
5581
- drm_eld_size (eld ), total_sad_count );
5588
+ drm_dbg_kms (connector -> dev , "[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n" ,
5589
+ connector -> base .id , connector -> name ,
5590
+ drm_eld_size (eld ), total_sad_count );
5582
5591
}
5583
5592
5584
5593
static int _drm_edid_to_sad (const struct drm_edid * drm_edid ,
@@ -5849,7 +5858,8 @@ static void drm_parse_vcdb(struct drm_connector *connector, const u8 *db)
5849
5858
{
5850
5859
struct drm_display_info * info = & connector -> display_info ;
5851
5860
5852
- DRM_DEBUG_KMS ("CEA VCDB 0x%02x\n" , db [2 ]);
5861
+ drm_dbg_kms (connector -> dev , "[CONNECTOR:%d:%s] CEA VCDB 0x%02x\n" ,
5862
+ connector -> base .id , connector -> name , db [2 ]);
5853
5863
5854
5864
if (db [2 ] & EDID_CEA_VCDB_QS )
5855
5865
info -> rgb_quant_range_selectable = true;
@@ -6052,48 +6062,48 @@ static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector,
6052
6062
if (hdmi [6 ] & DRM_EDID_HDMI_DC_30 ) {
6053
6063
dc_bpc = 10 ;
6054
6064
info -> edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30 ;
6055
- DRM_DEBUG ( "%s: HDMI sink does deep color 30.\n" ,
6056
- connector -> name );
6065
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n" ,
6066
+ connector -> base . id , connector -> name );
6057
6067
}
6058
6068
6059
6069
if (hdmi [6 ] & DRM_EDID_HDMI_DC_36 ) {
6060
6070
dc_bpc = 12 ;
6061
6071
info -> edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36 ;
6062
- DRM_DEBUG ( "%s: HDMI sink does deep color 36.\n" ,
6063
- connector -> name );
6072
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n" ,
6073
+ connector -> base . id , connector -> name );
6064
6074
}
6065
6075
6066
6076
if (hdmi [6 ] & DRM_EDID_HDMI_DC_48 ) {
6067
6077
dc_bpc = 16 ;
6068
6078
info -> edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48 ;
6069
- DRM_DEBUG ( "%s: HDMI sink does deep color 48.\n" ,
6070
- connector -> name );
6079
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n" ,
6080
+ connector -> base . id , connector -> name );
6071
6081
}
6072
6082
6073
6083
if (dc_bpc == 0 ) {
6074
- DRM_DEBUG ( "%s: No deep color support on this HDMI sink.\n" ,
6075
- connector -> name );
6084
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] No deep color support on this HDMI sink.\n" ,
6085
+ connector -> base . id , connector -> name );
6076
6086
return ;
6077
6087
}
6078
6088
6079
- DRM_DEBUG ( "%s: Assigning HDMI sink color depth as %d bpc.\n" ,
6080
- connector -> name , dc_bpc );
6089
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] Assigning HDMI sink color depth as %d bpc.\n" ,
6090
+ connector -> base . id , connector -> name , dc_bpc );
6081
6091
info -> bpc = dc_bpc ;
6082
6092
6083
6093
/* YCRCB444 is optional according to spec. */
6084
6094
if (hdmi [6 ] & DRM_EDID_HDMI_DC_Y444 ) {
6085
6095
info -> edid_hdmi_ycbcr444_dc_modes = info -> edid_hdmi_rgb444_dc_modes ;
6086
- DRM_DEBUG ( "%s: HDMI sink does YCRCB444 in deep color.\n" ,
6087
- connector -> name );
6096
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n" ,
6097
+ connector -> base . id , connector -> name );
6088
6098
}
6089
6099
6090
6100
/*
6091
6101
* Spec says that if any deep color mode is supported at all,
6092
6102
* then deep color 36 bit must be supported.
6093
6103
*/
6094
6104
if (!(hdmi [6 ] & DRM_EDID_HDMI_DC_36 )) {
6095
- DRM_DEBUG ( "%s: HDMI sink should do DC_36, but does not!\n" ,
6096
- connector -> name );
6105
+ drm_dbg_kms ( connector -> dev , "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n" ,
6106
+ connector -> base . id , connector -> name );
6097
6107
}
6098
6108
}
6099
6109
@@ -6110,10 +6120,9 @@ drm_parse_hdmi_vsdb_video(struct drm_connector *connector, const u8 *db)
6110
6120
if (len >= 7 )
6111
6121
info -> max_tmds_clock = db [7 ] * 5000 ;
6112
6122
6113
- DRM_DEBUG_KMS ("HDMI: DVI dual %d, "
6114
- "max TMDS clock %d kHz\n" ,
6115
- info -> dvi_dual ,
6116
- info -> max_tmds_clock );
6123
+ drm_dbg_kms (connector -> dev , "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n" ,
6124
+ connector -> base .id , connector -> name ,
6125
+ info -> dvi_dual , info -> max_tmds_clock );
6117
6126
6118
6127
drm_parse_hdmi_deep_color_info (connector , db );
6119
6128
}
@@ -6156,8 +6165,10 @@ static void drm_parse_cea_ext(struct drm_connector *connector,
6156
6165
info -> cea_rev = edid_ext [1 ];
6157
6166
6158
6167
if (info -> cea_rev != edid_ext [1 ])
6159
- DRM_DEBUG_KMS ("CEA extension version mismatch %u != %u\n" ,
6160
- info -> cea_rev , edid_ext [1 ]);
6168
+ drm_dbg_kms (connector -> dev ,
6169
+ "[CONNECTOR:%d:%s] CEA extension version mismatch %u != %u\n" ,
6170
+ connector -> base .id , connector -> name ,
6171
+ info -> cea_rev , edid_ext [1 ]);
6161
6172
6162
6173
/* The existence of a CTA extension should imply RGB support */
6163
6174
info -> color_formats = DRM_COLOR_FORMAT_RGB444 ;
@@ -6243,9 +6254,10 @@ static void drm_get_monitor_range(struct drm_connector *connector,
6243
6254
6244
6255
drm_for_each_detailed_block (drm_edid , get_monitor_range , & closure );
6245
6256
6246
- DRM_DEBUG_KMS ("Supported Monitor Refresh rate range is %d Hz - %d Hz\n" ,
6247
- info -> monitor_range .min_vfreq ,
6248
- info -> monitor_range .max_vfreq );
6257
+ drm_dbg_kms (connector -> dev ,
6258
+ "[CONNECTOR:%d:%s] Supported Monitor Refresh rate range is %d Hz - %d Hz\n" ,
6259
+ connector -> base .id , connector -> name ,
6260
+ info -> monitor_range .min_vfreq , info -> monitor_range .max_vfreq );
6249
6261
}
6250
6262
6251
6263
static void drm_parse_vesa_mso_data (struct drm_connector * connector ,
@@ -6387,8 +6399,9 @@ static u32 update_display_info(struct drm_connector *connector,
6387
6399
if (info -> bpc == 0 && edid -> revision == 3 &&
6388
6400
edid -> input & DRM_EDID_DIGITAL_DFP_1_X ) {
6389
6401
info -> bpc = 8 ;
6390
- DRM_DEBUG ("%s: Assigning DFP sink color depth as %d bpc.\n" ,
6391
- connector -> name , info -> bpc );
6402
+ drm_dbg_kms (connector -> dev ,
6403
+ "[CONNECTOR:%d:%s] Assigning DFP sink color depth as %d bpc.\n" ,
6404
+ connector -> base .id , connector -> name , info -> bpc );
6392
6405
}
6393
6406
6394
6407
/* Only defined for 1.4 with digital displays */
@@ -6420,8 +6433,9 @@ static u32 update_display_info(struct drm_connector *connector,
6420
6433
break ;
6421
6434
}
6422
6435
6423
- DRM_DEBUG ("%s: Assigning EDID-1.4 digital sink color depth as %d bpc.\n" ,
6424
- connector -> name , info -> bpc );
6436
+ drm_dbg_kms (connector -> dev ,
6437
+ "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n" ,
6438
+ connector -> base .id , connector -> name , info -> bpc );
6425
6439
6426
6440
if (edid -> features & DRM_EDID_FEATURE_RGB_YCRCB444 )
6427
6441
info -> color_formats |= DRM_COLOR_FORMAT_YCBCR444 ;
@@ -7121,11 +7135,14 @@ static void drm_parse_tiled_block(struct drm_connector *connector,
7121
7135
connector -> tile_h_size = w + 1 ;
7122
7136
connector -> tile_v_size = h + 1 ;
7123
7137
7124
- DRM_DEBUG_KMS ("tile cap 0x%x\n" , tile -> tile_cap );
7125
- DRM_DEBUG_KMS ("tile_size %d x %d\n" , w + 1 , h + 1 );
7126
- DRM_DEBUG_KMS ("topo num tiles %dx%d, location %dx%d\n" ,
7127
- num_h_tile + 1 , num_v_tile + 1 , tile_h_loc , tile_v_loc );
7128
- DRM_DEBUG_KMS ("vend %c%c%c\n" , tile -> topology_id [0 ], tile -> topology_id [1 ], tile -> topology_id [2 ]);
7138
+ drm_dbg_kms (connector -> dev ,
7139
+ "[CONNECTOR:%d:%s] tile cap 0x%x, size %dx%d, num tiles %dx%d, location %dx%d, vend %c%c%c" ,
7140
+ connector -> base .id , connector -> name ,
7141
+ tile -> tile_cap ,
7142
+ connector -> tile_h_size , connector -> tile_v_size ,
7143
+ connector -> num_h_tile , connector -> num_v_tile ,
7144
+ connector -> tile_h_loc , connector -> tile_v_loc ,
7145
+ tile -> topology_id [0 ], tile -> topology_id [1 ], tile -> topology_id [2 ]);
7129
7146
7130
7147
tg = drm_mode_get_tile_group (connector -> dev , tile -> topology_id );
7131
7148
if (!tg )
0 commit comments