• J
    drm/i915: respect the VBT minimum backlight brightness · 6dda730e
    Jani Nikula 提交于
    Historically we've exposed the full backlight PWM duty cycle range to
    the userspace, in the name of "mechanism, not policy". However, it turns
    out there are both panels and board designs where there is a minimum
    duty cycle that is required for proper operation. The minimum duty cycle
    is available in the VBT.
    
    The backlight class sysfs interface does not make any promises to the
    userspace about the physical meaning of the range
    0..max_brightness. Specifically there is no guarantee that 0 means off;
    indeed for acpi_backlight 0 usually is not off, but the minimum
    acceptable value.
    
    Respect the minimum backlight, and expose the range acceptable to the
    hardware as 0..max_brightness to the userspace via the backlight class
    device; 0 means the minimum acceptable enabled value. To switch off the
    backlight, the user must disable the encoder.
    
    As a side effect, make the backlight class device max brightness and
    physical PWM modulation frequency (i.e. max duty cycle)
    independent. This allows a follow-up patch to virtualize the max value
    exposed to the userspace.
    Signed-off-by: NJani Nikula <jani.nikula@intel.com>
    Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
    [danvet: s/BUG_ON/WARN_ON/]
    Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
    6dda730e
intel_panel.c 39.6 KB