@@ -475,43 +475,13 @@ static u32 intel_dp_aux_vesa_get_backlight(struct intel_connector *connector, en
475
475
return connector -> panel .backlight .level ;
476
476
}
477
477
478
- static int
479
- intel_dp_aux_vesa_set_luminance (struct intel_connector * connector , u32 level )
480
- {
481
- struct intel_dp * intel_dp = enc_to_intel_dp (connector -> encoder );
482
- u8 buf [3 ];
483
- int ret ;
484
-
485
- level = level * 1000 ;
486
- level &= 0xffffff ;
487
- buf [0 ] = (level & 0x0000ff );
488
- buf [1 ] = (level & 0x00ff00 ) >> 8 ;
489
- buf [2 ] = (level & 0xff0000 ) >> 16 ;
490
-
491
- ret = drm_dp_dpcd_write (& intel_dp -> aux , DP_EDP_PANEL_TARGET_LUMINANCE_VALUE ,
492
- buf , sizeof (buf ));
493
- if (ret != sizeof (buf )) {
494
- drm_err (intel_dp -> aux .drm_dev ,
495
- "%s: Failed to set VESA Aux Luminance: %d\n" ,
496
- intel_dp -> aux .name , ret );
497
- return - EINVAL ;
498
- } else {
499
- return 0 ;
500
- }
501
- }
502
-
503
478
static void
504
479
intel_dp_aux_vesa_set_backlight (const struct drm_connector_state * conn_state , u32 level )
505
480
{
506
481
struct intel_connector * connector = to_intel_connector (conn_state -> connector );
507
482
struct intel_panel * panel = & connector -> panel ;
508
483
struct intel_dp * intel_dp = enc_to_intel_dp (connector -> encoder );
509
484
510
- if (panel -> backlight .edp .vesa .luminance_control_support ) {
511
- if (!intel_dp_aux_vesa_set_luminance (connector , level ))
512
- return ;
513
- }
514
-
515
485
if (!panel -> backlight .edp .vesa .info .aux_set ) {
516
486
const u32 pwm_level = intel_backlight_level_to_pwm (connector , level );
517
487
@@ -537,7 +507,9 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state,
537
507
if (ret == 1 )
538
508
return ;
539
509
540
- if (!intel_dp_aux_vesa_set_luminance (connector , level ))
510
+ if (!drm_edp_backlight_set_level (& intel_dp -> aux ,
511
+ & panel -> backlight .edp .vesa .info ,
512
+ level ))
541
513
return ;
542
514
}
543
515
0 commit comments