intel_extreme: set/get brightness in legacy mode for gen2,i915GM,i945GM

untested, see #15448

Change-Id: Iaf0cdacd39ebadfc143b072bdd6f5435a1394f45
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5222
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
Jérôme Duval
2022-04-21 18:29:23 +00:00
committed by waddlesplash
parent 1043e934e4
commit 6c02429697
3 changed files with 72 additions and 2 deletions
@@ -398,7 +398,9 @@ enum {
INTEL_GET_DEVICE_NAME,
INTEL_ALLOCATE_GRAPHICS_MEMORY,
INTEL_FREE_GRAPHICS_MEMORY
INTEL_FREE_GRAPHICS_MEMORY,
INTEL_GET_BRIGHTNESS_LEGACY,
INTEL_SET_BRIGHTNESS_LEGACY
};
// retrieve the area_id of the kernel/accelerant shared info
@@ -422,6 +424,12 @@ struct intel_free_graphics_memory {
addr_t buffer_base;
};
// brightness legacy
struct intel_brightness_legacy {
uint32 magic;
uint8 lpc;
};
//----------------------------------------------------------
// Register definitions, taken from X driver
@@ -535,6 +543,9 @@ struct intel_free_graphics_memory {
#define BDW_GTT_SIZE_4MB (2 << 6)
#define BDW_GTT_SIZE_8MB (3 << 6)
// Gen2, i915GM, i945GM
#define LEGACY_BACKLIGHT_BRIGHTNESS 0xf4
// graphics page translation table
#define INTEL_PAGE_TABLE_CONTROL 0x02020
#define PAGE_TABLE_ENABLED 0x00000001
@@ -1218,6 +1229,7 @@ struct intel_free_graphics_memory {
#define MCH_BLC_PWM_CTL (0x1254 | REGS_NORTH_PIPE_AND_PORT)
// Linux VLV_BLC_PWM_CTL (one register per pipe) or BLC_PWM_CTL (a single register that can be
// programmed for use on either pipe)
#define BLM_LEGACY_MODE (1 << 16)
// ring buffer commands