mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
drm/i915/quirks: abstract quirks further by making quirk ids an enum
Turn the quirk ids to enums instead of bits, and hide the masking inside intel_quirks.c. Define the enums in intel_quirks.h to declutter i915_drv.h while at it. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/60d8a20e1f8845b0bef53c2e32d524be888e426d.1661779055.git.jani.nikula@intel.com
This commit is contained in:
parent
0c82118b0a
commit
deb141510f
3 changed files with 23 additions and 16 deletions
|
@ -9,12 +9,17 @@
|
|||
#include "intel_display_types.h"
|
||||
#include "intel_quirks.h"
|
||||
|
||||
static void intel_set_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk)
|
||||
{
|
||||
i915->quirks |= BIT(quirk);
|
||||
}
|
||||
|
||||
/*
|
||||
* Some machines (Lenovo U160) do not work with SSC on LVDS for some reason
|
||||
*/
|
||||
static void quirk_ssc_force_disable(struct drm_i915_private *i915)
|
||||
{
|
||||
i915->quirks |= QUIRK_LVDS_SSC_DISABLE;
|
||||
intel_set_quirk(i915, QUIRK_LVDS_SSC_DISABLE);
|
||||
drm_info(&i915->drm, "applying lvds SSC disable quirk\n");
|
||||
}
|
||||
|
||||
|
@ -24,14 +29,14 @@ static void quirk_ssc_force_disable(struct drm_i915_private *i915)
|
|||
*/
|
||||
static void quirk_invert_brightness(struct drm_i915_private *i915)
|
||||
{
|
||||
i915->quirks |= QUIRK_INVERT_BRIGHTNESS;
|
||||
intel_set_quirk(i915, QUIRK_INVERT_BRIGHTNESS);
|
||||
drm_info(&i915->drm, "applying inverted panel brightness quirk\n");
|
||||
}
|
||||
|
||||
/* Some VBT's incorrectly indicate no backlight is present */
|
||||
static void quirk_backlight_present(struct drm_i915_private *i915)
|
||||
{
|
||||
i915->quirks |= QUIRK_BACKLIGHT_PRESENT;
|
||||
intel_set_quirk(i915, QUIRK_BACKLIGHT_PRESENT);
|
||||
drm_info(&i915->drm, "applying backlight present quirk\n");
|
||||
}
|
||||
|
||||
|
@ -40,7 +45,7 @@ static void quirk_backlight_present(struct drm_i915_private *i915)
|
|||
*/
|
||||
static void quirk_increase_t12_delay(struct drm_i915_private *i915)
|
||||
{
|
||||
i915->quirks |= QUIRK_INCREASE_T12_DELAY;
|
||||
intel_set_quirk(i915, QUIRK_INCREASE_T12_DELAY);
|
||||
drm_info(&i915->drm, "Applying T12 delay quirk\n");
|
||||
}
|
||||
|
||||
|
@ -50,13 +55,13 @@ static void quirk_increase_t12_delay(struct drm_i915_private *i915)
|
|||
*/
|
||||
static void quirk_increase_ddi_disabled_time(struct drm_i915_private *i915)
|
||||
{
|
||||
i915->quirks |= QUIRK_INCREASE_DDI_DISABLED_TIME;
|
||||
intel_set_quirk(i915, QUIRK_INCREASE_DDI_DISABLED_TIME);
|
||||
drm_info(&i915->drm, "Applying Increase DDI Disabled quirk\n");
|
||||
}
|
||||
|
||||
static void quirk_no_pps_backlight_power_hook(struct drm_i915_private *i915)
|
||||
{
|
||||
i915->quirks |= QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK;
|
||||
intel_set_quirk(i915, QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK);
|
||||
drm_info(&i915->drm, "Applying no pps backlight power quirk\n");
|
||||
}
|
||||
|
||||
|
@ -217,7 +222,7 @@ void intel_init_quirks(struct drm_i915_private *i915)
|
|||
}
|
||||
}
|
||||
|
||||
bool intel_has_quirk(struct drm_i915_private *i915, unsigned long quirk)
|
||||
bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk)
|
||||
{
|
||||
return i915->quirks & quirk;
|
||||
return i915->quirks & BIT(quirk);
|
||||
}
|
||||
|
|
|
@ -10,7 +10,16 @@
|
|||
|
||||
struct drm_i915_private;
|
||||
|
||||
enum intel_quirk_id {
|
||||
QUIRK_BACKLIGHT_PRESENT,
|
||||
QUIRK_INCREASE_DDI_DISABLED_TIME,
|
||||
QUIRK_INCREASE_T12_DELAY,
|
||||
QUIRK_INVERT_BRIGHTNESS,
|
||||
QUIRK_LVDS_SSC_DISABLE,
|
||||
QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK,
|
||||
};
|
||||
|
||||
void intel_init_quirks(struct drm_i915_private *i915);
|
||||
bool intel_has_quirk(struct drm_i915_private *i915, unsigned long quirk);
|
||||
bool intel_has_quirk(struct drm_i915_private *i915, enum intel_quirk_id quirk);
|
||||
|
||||
#endif /* __INTEL_QUIRKS_H__ */
|
||||
|
|
|
@ -90,13 +90,6 @@ struct vlv_s0ix_state;
|
|||
|
||||
#define GEM_QUIRK_PIN_SWIZZLED_PAGES BIT(0)
|
||||
|
||||
#define QUIRK_LVDS_SSC_DISABLE (1<<1)
|
||||
#define QUIRK_INVERT_BRIGHTNESS (1<<2)
|
||||
#define QUIRK_BACKLIGHT_PRESENT (1<<3)
|
||||
#define QUIRK_INCREASE_T12_DELAY (1<<6)
|
||||
#define QUIRK_INCREASE_DDI_DISABLED_TIME (1<<7)
|
||||
#define QUIRK_NO_PPS_BACKLIGHT_POWER_HOOK (1<<8)
|
||||
|
||||
struct i915_suspend_saved_registers {
|
||||
u32 saveDSPARB;
|
||||
u32 saveSWF0[16];
|
||||
|
|
Loading…
Reference in a new issue