video_extension.txt 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. ACPI video extensions
  2. ~~~~~~~~~~~~~~~~~~~~~
  3. This driver implement the ACPI Extensions For Display Adapters for
  4. integrated graphics devices on motherboard, as specified in ACPI 2.0
  5. Specification, Appendix B, allowing to perform some basic control like
  6. defining the video POST device, retrieving EDID information or to
  7. setup a video output, etc. Note that this is an ref. implementation
  8. only. It may or may not work for your integrated video device.
  9. The ACPI video driver does 3 things regarding backlight control:
  10. 1 Export a sysfs interface for user space to control backlight level
  11. If the ACPI table has a video device, and acpi_backlight=vendor kernel
  12. command line is not present, the driver will register a backlight device
  13. and set the required backlight operation structure for it for the sysfs
  14. interface control. For every registered class device, there will be a
  15. directory named acpi_videoX under /sys/class/backlight.
  16. The backlight sysfs interface has a standard definition here:
  17. Documentation/ABI/stable/sysfs-class-backlight.
  18. And what ACPI video driver does is:
  19. actual_brightness: on read, control method _BQC will be evaluated to
  20. get the brightness level the firmware thinks it is at;
  21. bl_power: not implemented, will set the current brightness instead;
  22. brightness: on write, control method _BCM will run to set the requested
  23. brightness level;
  24. max_brightness: Derived from the _BCL package(see below);
  25. type: firmware
  26. Note that ACPI video backlight driver will always use index for
  27. brightness, actual_brightness and max_brightness. So if we have
  28. the following _BCL package:
  29. Method (_BCL, 0, NotSerialized)
  30. {
  31. Return (Package (0x0C)
  32. {
  33. 0x64,
  34. 0x32,
  35. 0x0A,
  36. 0x14,
  37. 0x1E,
  38. 0x28,
  39. 0x32,
  40. 0x3C,
  41. 0x46,
  42. 0x50,
  43. 0x5A,
  44. 0x64
  45. })
  46. }
  47. The first two levels are for when laptop are on AC or on battery and are
  48. not used by Linux currently. The remaining 10 levels are supported levels
  49. that we can choose from. The applicable index values are from 0 (that
  50. corresponds to the 0x0A brightness value) to 9 (that corresponds to the
  51. 0x64 brightness value) inclusive. Each of those index values is regarded
  52. as a "brightness level" indicator. Thus from the user space perspective
  53. the range of available brightness levels is from 0 to 9 (max_brightness)
  54. inclusive.
  55. 2 Notify user space about hotkey event
  56. There are generally two cases for hotkey event reporting:
  57. i) For some laptops, when user presses the hotkey, a scancode will be
  58. generated and sent to user space through the input device created by
  59. the keyboard driver as a key type input event, with proper remap, the
  60. following key code will appear to user space:
  61. EV_KEY, KEY_BRIGHTNESSUP
  62. EV_KEY, KEY_BRIGHTNESSDOWN
  63. etc.
  64. For this case, ACPI video driver does not need to do anything(actually,
  65. it doesn't even know this happened).
  66. ii) For some laptops, the press of the hotkey will not generate the
  67. scancode, instead, firmware will notify the video device ACPI node
  68. about the event. The event value is defined in the ACPI spec. ACPI
  69. video driver will generate an key type input event according to the
  70. notify value it received and send the event to user space through the
  71. input device it created:
  72. event keycode
  73. 0x86 KEY_BRIGHTNESSUP
  74. 0x87 KEY_BRIGHTNESSDOWN
  75. etc.
  76. so this would lead to the same effect as case i) now.
  77. Once user space tool receives this event, it can modify the backlight
  78. level through the sysfs interface.
  79. 3 Change backlight level in the kernel
  80. This works for machines covered by case ii) in Section 2. Once the driver
  81. received a notification, it will set the backlight level accordingly. This does
  82. not affect the sending of event to user space, they are always sent to user
  83. space regardless of whether or not the video module controls the backlight level
  84. directly. This behaviour can be controlled through the brightness_switch_enabled
  85. module parameter as documented in kernel-parameters.txt. It is recommended to
  86. disable this behaviour once a GUI environment starts up and wants to have full
  87. control of the backlight level.