Commit 7249dfcb authored by Jani Nikula's avatar Jani Nikula

drm/i915: move opregion to display.opregion

Move display opregion related members under drm_i915_private display
sub-struct.
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/a0ceb5148835fa3e0828786ae491fcd11e2e77ff.1661779055.git.jani.nikula@intel.com
parent f0acaf9d
...@@ -3080,7 +3080,7 @@ static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915) ...@@ -3080,7 +3080,7 @@ static struct vbt_header *oprom_get_vbt(struct drm_i915_private *i915)
*/ */
void intel_bios_init(struct drm_i915_private *i915) void intel_bios_init(struct drm_i915_private *i915)
{ {
const struct vbt_header *vbt = i915->opregion.vbt; const struct vbt_header *vbt = i915->display.opregion.vbt;
struct vbt_header *oprom_vbt = NULL; struct vbt_header *oprom_vbt = NULL;
const struct bdb_header *bdb; const struct bdb_header *bdb;
...@@ -3287,7 +3287,7 @@ bool intel_bios_is_lvds_present(struct drm_i915_private *i915, u8 *i2c_pin) ...@@ -3287,7 +3287,7 @@ bool intel_bios_is_lvds_present(struct drm_i915_private *i915, u8 *i2c_pin)
* additional data. Trust that if the VBT was written into * additional data. Trust that if the VBT was written into
* the OpRegion then they have validated the LVDS's existence. * the OpRegion then they have validated the LVDS's existence.
*/ */
if (i915->opregion.vbt) if (i915->display.opregion.vbt)
return true; return true;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "intel_dpll_mgr.h" #include "intel_dpll_mgr.h"
#include "intel_global_state.h" #include "intel_global_state.h"
#include "intel_gmbus.h" #include "intel_gmbus.h"
#include "intel_opregion.h"
#include "intel_pm_types.h" #include "intel_pm_types.h"
struct drm_i915_private; struct drm_i915_private;
...@@ -284,6 +285,7 @@ struct intel_display { ...@@ -284,6 +285,7 @@ struct intel_display {
struct intel_dmc dmc; struct intel_dmc dmc;
struct intel_dpll dpll; struct intel_dpll dpll;
struct intel_hotplug hotplug; struct intel_hotplug hotplug;
struct intel_opregion opregion;
struct intel_overlay *overlay; struct intel_overlay *overlay;
struct intel_wm wm; struct intel_wm wm;
}; };
......
...@@ -103,7 +103,8 @@ static int i915_sr_status(struct seq_file *m, void *unused) ...@@ -103,7 +103,8 @@ static int i915_sr_status(struct seq_file *m, void *unused)
static int i915_opregion(struct seq_file *m, void *unused) static int i915_opregion(struct seq_file *m, void *unused)
{ {
struct intel_opregion *opregion = &node_to_i915(m->private)->opregion; struct drm_i915_private *i915 = node_to_i915(m->private);
struct intel_opregion *opregion = &i915->display.opregion;
if (opregion->header) if (opregion->header)
seq_write(m, opregion->header, OPREGION_SIZE); seq_write(m, opregion->header, OPREGION_SIZE);
...@@ -113,7 +114,8 @@ static int i915_opregion(struct seq_file *m, void *unused) ...@@ -113,7 +114,8 @@ static int i915_opregion(struct seq_file *m, void *unused)
static int i915_vbt(struct seq_file *m, void *unused) static int i915_vbt(struct seq_file *m, void *unused)
{ {
struct intel_opregion *opregion = &node_to_i915(m->private)->opregion; struct drm_i915_private *i915 = node_to_i915(m->private);
struct intel_opregion *opregion = &i915->display.opregion;
if (opregion->vbt) if (opregion->vbt)
seq_write(m, opregion->vbt, opregion->vbt_size); seq_write(m, opregion->vbt, opregion->vbt_size);
......
...@@ -252,7 +252,7 @@ struct opregion_asle_ext { ...@@ -252,7 +252,7 @@ struct opregion_asle_ext {
static int check_swsci_function(struct drm_i915_private *i915, u32 function) static int check_swsci_function(struct drm_i915_private *i915, u32 function)
{ {
struct opregion_swsci *swsci = i915->opregion.swsci; struct opregion_swsci *swsci = i915->display.opregion.swsci;
u32 main_function, sub_function; u32 main_function, sub_function;
if (!swsci) if (!swsci)
...@@ -265,11 +265,11 @@ static int check_swsci_function(struct drm_i915_private *i915, u32 function) ...@@ -265,11 +265,11 @@ static int check_swsci_function(struct drm_i915_private *i915, u32 function)
/* Check if we can call the function. See swsci_setup for details. */ /* Check if we can call the function. See swsci_setup for details. */
if (main_function == SWSCI_SBCB) { if (main_function == SWSCI_SBCB) {
if ((i915->opregion.swsci_sbcb_sub_functions & if ((i915->display.opregion.swsci_sbcb_sub_functions &
(1 << sub_function)) == 0) (1 << sub_function)) == 0)
return -EINVAL; return -EINVAL;
} else if (main_function == SWSCI_GBDA) { } else if (main_function == SWSCI_GBDA) {
if ((i915->opregion.swsci_gbda_sub_functions & if ((i915->display.opregion.swsci_gbda_sub_functions &
(1 << sub_function)) == 0) (1 << sub_function)) == 0)
return -EINVAL; return -EINVAL;
} }
...@@ -280,7 +280,7 @@ static int check_swsci_function(struct drm_i915_private *i915, u32 function) ...@@ -280,7 +280,7 @@ static int check_swsci_function(struct drm_i915_private *i915, u32 function)
static int swsci(struct drm_i915_private *dev_priv, static int swsci(struct drm_i915_private *dev_priv,
u32 function, u32 parm, u32 *parm_out) u32 function, u32 parm, u32 *parm_out)
{ {
struct opregion_swsci *swsci = dev_priv->opregion.swsci; struct opregion_swsci *swsci = dev_priv->display.opregion.swsci;
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u32 scic, dslp; u32 scic, dslp;
u16 swsci_val; u16 swsci_val;
...@@ -462,7 +462,7 @@ static u32 asle_set_backlight(struct drm_i915_private *dev_priv, u32 bclp) ...@@ -462,7 +462,7 @@ static u32 asle_set_backlight(struct drm_i915_private *dev_priv, u32 bclp)
{ {
struct intel_connector *connector; struct intel_connector *connector;
struct drm_connector_list_iter conn_iter; struct drm_connector_list_iter conn_iter;
struct opregion_asle *asle = dev_priv->opregion.asle; struct opregion_asle *asle = dev_priv->display.opregion.asle;
struct drm_device *dev = &dev_priv->drm; struct drm_device *dev = &dev_priv->drm;
drm_dbg(&dev_priv->drm, "bclp = 0x%08x\n", bclp); drm_dbg(&dev_priv->drm, "bclp = 0x%08x\n", bclp);
...@@ -586,8 +586,8 @@ static void asle_work(struct work_struct *work) ...@@ -586,8 +586,8 @@ static void asle_work(struct work_struct *work)
struct intel_opregion *opregion = struct intel_opregion *opregion =
container_of(work, struct intel_opregion, asle_work); container_of(work, struct intel_opregion, asle_work);
struct drm_i915_private *dev_priv = struct drm_i915_private *dev_priv =
container_of(opregion, struct drm_i915_private, opregion); container_of(opregion, struct drm_i915_private, display.opregion);
struct opregion_asle *asle = dev_priv->opregion.asle; struct opregion_asle *asle = dev_priv->display.opregion.asle;
u32 aslc_stat = 0; u32 aslc_stat = 0;
u32 aslc_req; u32 aslc_req;
...@@ -635,8 +635,8 @@ static void asle_work(struct work_struct *work) ...@@ -635,8 +635,8 @@ static void asle_work(struct work_struct *work)
void intel_opregion_asle_intr(struct drm_i915_private *dev_priv) void intel_opregion_asle_intr(struct drm_i915_private *dev_priv)
{ {
if (dev_priv->opregion.asle) if (dev_priv->display.opregion.asle)
schedule_work(&dev_priv->opregion.asle_work); schedule_work(&dev_priv->display.opregion.asle_work);
} }
#define ACPI_EV_DISPLAY_SWITCH (1<<0) #define ACPI_EV_DISPLAY_SWITCH (1<<0)
...@@ -692,7 +692,7 @@ static void set_did(struct intel_opregion *opregion, int i, u32 val) ...@@ -692,7 +692,7 @@ static void set_did(struct intel_opregion *opregion, int i, u32 val)
static void intel_didl_outputs(struct drm_i915_private *dev_priv) static void intel_didl_outputs(struct drm_i915_private *dev_priv)
{ {
struct intel_opregion *opregion = &dev_priv->opregion; struct intel_opregion *opregion = &dev_priv->display.opregion;
struct intel_connector *connector; struct intel_connector *connector;
struct drm_connector_list_iter conn_iter; struct drm_connector_list_iter conn_iter;
int i = 0, max_outputs; int i = 0, max_outputs;
...@@ -731,7 +731,7 @@ static void intel_didl_outputs(struct drm_i915_private *dev_priv) ...@@ -731,7 +731,7 @@ static void intel_didl_outputs(struct drm_i915_private *dev_priv)
static void intel_setup_cadls(struct drm_i915_private *dev_priv) static void intel_setup_cadls(struct drm_i915_private *dev_priv)
{ {
struct intel_opregion *opregion = &dev_priv->opregion; struct intel_opregion *opregion = &dev_priv->display.opregion;
struct intel_connector *connector; struct intel_connector *connector;
struct drm_connector_list_iter conn_iter; struct drm_connector_list_iter conn_iter;
int i = 0; int i = 0;
...@@ -761,7 +761,7 @@ static void intel_setup_cadls(struct drm_i915_private *dev_priv) ...@@ -761,7 +761,7 @@ static void intel_setup_cadls(struct drm_i915_private *dev_priv)
static void swsci_setup(struct drm_i915_private *dev_priv) static void swsci_setup(struct drm_i915_private *dev_priv)
{ {
struct intel_opregion *opregion = &dev_priv->opregion; struct intel_opregion *opregion = &dev_priv->display.opregion;
bool requested_callbacks = false; bool requested_callbacks = false;
u32 tmp; u32 tmp;
...@@ -839,7 +839,7 @@ static const struct dmi_system_id intel_no_opregion_vbt[] = { ...@@ -839,7 +839,7 @@ static const struct dmi_system_id intel_no_opregion_vbt[] = {
static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv) static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv)
{ {
struct intel_opregion *opregion = &dev_priv->opregion; struct intel_opregion *opregion = &dev_priv->display.opregion;
const struct firmware *fw = NULL; const struct firmware *fw = NULL;
const char *name = dev_priv->params.vbt_firmware; const char *name = dev_priv->params.vbt_firmware;
int ret; int ret;
...@@ -879,7 +879,7 @@ static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv) ...@@ -879,7 +879,7 @@ static int intel_load_vbt_firmware(struct drm_i915_private *dev_priv)
int intel_opregion_setup(struct drm_i915_private *dev_priv) int intel_opregion_setup(struct drm_i915_private *dev_priv)
{ {
struct intel_opregion *opregion = &dev_priv->opregion; struct intel_opregion *opregion = &dev_priv->display.opregion;
struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev); struct pci_dev *pdev = to_pci_dev(dev_priv->drm.dev);
u32 asls, mboxes; u32 asls, mboxes;
char buf[sizeof(OPREGION_SIGNATURE)]; char buf[sizeof(OPREGION_SIGNATURE)];
...@@ -1106,7 +1106,7 @@ struct edid *intel_opregion_get_edid(struct intel_connector *intel_connector) ...@@ -1106,7 +1106,7 @@ struct edid *intel_opregion_get_edid(struct intel_connector *intel_connector)
{ {
struct drm_connector *connector = &intel_connector->base; struct drm_connector *connector = &intel_connector->base;
struct drm_i915_private *i915 = to_i915(connector->dev); struct drm_i915_private *i915 = to_i915(connector->dev);
struct intel_opregion *opregion = &i915->opregion; struct intel_opregion *opregion = &i915->display.opregion;
const void *in_edid; const void *in_edid;
const struct edid *edid; const struct edid *edid;
struct edid *new_edid; struct edid *new_edid;
...@@ -1141,7 +1141,7 @@ struct edid *intel_opregion_get_edid(struct intel_connector *intel_connector) ...@@ -1141,7 +1141,7 @@ struct edid *intel_opregion_get_edid(struct intel_connector *intel_connector)
bool intel_opregion_headless_sku(struct drm_i915_private *i915) bool intel_opregion_headless_sku(struct drm_i915_private *i915)
{ {
struct intel_opregion *opregion = &i915->opregion; struct intel_opregion *opregion = &i915->display.opregion;
struct opregion_header *header = opregion->header; struct opregion_header *header = opregion->header;
if (!header || header->over.major < 2 || if (!header || header->over.major < 2 ||
...@@ -1153,7 +1153,7 @@ bool intel_opregion_headless_sku(struct drm_i915_private *i915) ...@@ -1153,7 +1153,7 @@ bool intel_opregion_headless_sku(struct drm_i915_private *i915)
void intel_opregion_register(struct drm_i915_private *i915) void intel_opregion_register(struct drm_i915_private *i915)
{ {
struct intel_opregion *opregion = &i915->opregion; struct intel_opregion *opregion = &i915->display.opregion;
if (!opregion->header) if (!opregion->header)
return; return;
...@@ -1169,7 +1169,7 @@ void intel_opregion_register(struct drm_i915_private *i915) ...@@ -1169,7 +1169,7 @@ void intel_opregion_register(struct drm_i915_private *i915)
void intel_opregion_resume(struct drm_i915_private *i915) void intel_opregion_resume(struct drm_i915_private *i915)
{ {
struct intel_opregion *opregion = &i915->opregion; struct intel_opregion *opregion = &i915->display.opregion;
if (!opregion->header) if (!opregion->header)
return; return;
...@@ -1200,7 +1200,7 @@ void intel_opregion_resume(struct drm_i915_private *i915) ...@@ -1200,7 +1200,7 @@ void intel_opregion_resume(struct drm_i915_private *i915)
void intel_opregion_suspend(struct drm_i915_private *i915, pci_power_t state) void intel_opregion_suspend(struct drm_i915_private *i915, pci_power_t state)
{ {
struct intel_opregion *opregion = &i915->opregion; struct intel_opregion *opregion = &i915->display.opregion;
if (!opregion->header) if (!opregion->header)
return; return;
...@@ -1210,7 +1210,7 @@ void intel_opregion_suspend(struct drm_i915_private *i915, pci_power_t state) ...@@ -1210,7 +1210,7 @@ void intel_opregion_suspend(struct drm_i915_private *i915, pci_power_t state)
if (opregion->asle) if (opregion->asle)
opregion->asle->ardy = ASLE_ARDY_NOT_READY; opregion->asle->ardy = ASLE_ARDY_NOT_READY;
cancel_work_sync(&i915->opregion.asle_work); cancel_work_sync(&i915->display.opregion.asle_work);
if (opregion->acpi) if (opregion->acpi)
opregion->acpi->drdy = 0; opregion->acpi->drdy = 0;
...@@ -1218,7 +1218,7 @@ void intel_opregion_suspend(struct drm_i915_private *i915, pci_power_t state) ...@@ -1218,7 +1218,7 @@ void intel_opregion_suspend(struct drm_i915_private *i915, pci_power_t state)
void intel_opregion_unregister(struct drm_i915_private *i915) void intel_opregion_unregister(struct drm_i915_private *i915)
{ {
struct intel_opregion *opregion = &i915->opregion; struct intel_opregion *opregion = &i915->display.opregion;
intel_opregion_suspend(i915, PCI_D1); intel_opregion_suspend(i915, PCI_D1);
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "display/intel_dsb.h" #include "display/intel_dsb.h"
#include "display/intel_fbc.h" #include "display/intel_fbc.h"
#include "display/intel_frontbuffer.h" #include "display/intel_frontbuffer.h"
#include "display/intel_opregion.h"
#include "gem/i915_gem_context_types.h" #include "gem/i915_gem_context_types.h"
#include "gem/i915_gem_lmem.h" #include "gem/i915_gem_lmem.h"
...@@ -331,7 +330,6 @@ struct drm_i915_private { ...@@ -331,7 +330,6 @@ struct drm_i915_private {
u32 pipestat_irq_mask[I915_MAX_PIPES]; u32 pipestat_irq_mask[I915_MAX_PIPES];
struct intel_fbc *fbc[I915_MAX_FBCS]; struct intel_fbc *fbc[I915_MAX_FBCS];
struct intel_opregion opregion;
struct intel_vbt_data vbt; struct intel_vbt_data vbt;
bool preserve_bios_swizzle; bool preserve_bios_swizzle;
......
...@@ -595,7 +595,7 @@ void i915_disable_pipestat(struct drm_i915_private *dev_priv, ...@@ -595,7 +595,7 @@ void i915_disable_pipestat(struct drm_i915_private *dev_priv,
static bool i915_has_asle(struct drm_i915_private *dev_priv) static bool i915_has_asle(struct drm_i915_private *dev_priv)
{ {
if (!dev_priv->opregion.asle) if (!dev_priv->display.opregion.asle)
return false; return false;
return IS_PINEVIEW(dev_priv) || IS_MOBILE(dev_priv); return IS_PINEVIEW(dev_priv) || IS_MOBILE(dev_priv);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment