coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
graphics.c File Reference
#include <acpi/acpi.h>
#include <assert.h>
#include <bootmode.h>
#include <console/console.h>
#include <device/mmio.h>
#include <device/pci.h>
#include <device/pci_ids.h>
#include <drivers/intel/gma/i915.h>
#include <drivers/intel/gma/libgfxinit.h>
#include <drivers/intel/gma/opregion.h>
#include <intelblocks/cfg.h>
#include <intelblocks/graphics.h>
#include <fsp/graphics.h>
#include <soc/pci_devs.h>
#include <types.h>
Include dependency graph for graphics.c:

Go to the source code of this file.

Functions

__weak void graphics_soc_panel_init (struct device *dev)
 
__weak const struct i915_gpu_controller_infointel_igd_get_controller_info (const struct device *device)
 
static void gma_init (struct device *const dev)
 
static void gma_generate_ssdt (const struct device *device)
 
static int is_graphics_disabled (struct device *dev)
 
static uintptr_t graphics_get_bar (struct device *dev, unsigned long index)
 
uintptr_t graphics_get_framebuffer_address (void)
 
static uintptr_t graphics_get_gtt_base (void)
 
uint32_t graphics_gtt_read (unsigned long reg)
 
void graphics_gtt_write (unsigned long reg, uint32_t data)
 
void graphics_gtt_rmw (unsigned long reg, uint32_t andmask, uint32_t ormask)
 

Variables

static const struct device_operations graphics_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver graphics_driver __pci_driver
 

Function Documentation

◆ gma_generate_ssdt()

static void gma_generate_ssdt ( const struct device device)
static

Definition at line 82 of file graphics.c.

References drivers_intel_gma_displays_ssdt_generate(), and intel_igd_get_controller_info().

Here is the call graph for this function:

◆ gma_init()

◆ graphics_get_bar()

static uintptr_t graphics_get_bar ( struct device dev,
unsigned long  index 
)
static

Definition at line 99 of file graphics.c.

References resource::base, resource::index, and probe_resource().

Referenced by graphics_get_framebuffer_address(), and graphics_get_gtt_base().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphics_get_framebuffer_address()

uintptr_t graphics_get_framebuffer_address ( void  )

Definition at line 110 of file graphics.c.

References die_with_post_code, graphics_get_bar(), is_graphics_disabled(), PCI_BASE_ADDRESS_2, pcidev_path_on_root(), POST_HW_INIT_FAILURE, and SA_DEVFN_IGD.

Referenced by gma_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphics_get_gtt_base()

static uintptr_t graphics_get_gtt_base ( void  )
static

Definition at line 128 of file graphics.c.

References die(), die_with_post_code, graphics_get_bar(), is_graphics_disabled(), PCI_BASE_ADDRESS_0, pcidev_path_on_root(), POST_HW_INIT_FAILURE, and SA_DEVFN_IGD.

Referenced by graphics_gtt_read(), and graphics_gtt_write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphics_gtt_read()

uint32_t graphics_gtt_read ( unsigned long  reg)

Definition at line 149 of file graphics.c.

References graphics_get_gtt_base(), and read32().

Referenced by gma_init(), and graphics_gtt_rmw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphics_gtt_rmw()

void graphics_gtt_rmw ( unsigned long  reg,
uint32_t  andmask,
uint32_t  ormask 
)

Definition at line 159 of file graphics.c.

References graphics_gtt_read(), graphics_gtt_write(), and val.

Here is the call graph for this function:

◆ graphics_gtt_write()

void graphics_gtt_write ( unsigned long  reg,
uint32_t  data 
)

Definition at line 154 of file graphics.c.

References graphics_get_gtt_base(), and write32().

Referenced by gma_init(), and graphics_gtt_rmw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ graphics_soc_panel_init()

__weak void graphics_soc_panel_init ( struct device dev)

Definition at line 20 of file graphics.c.

◆ intel_igd_get_controller_info()

__weak const struct i915_gpu_controller_info* intel_igd_get_controller_info ( const struct device device)

Definition at line 29 of file graphics.c.

References NULL.

◆ is_graphics_disabled()

static int is_graphics_disabled ( struct device dev)
static

Definition at line 90 of file graphics.c.

References device::enabled.

Referenced by graphics_get_framebuffer_address(), and graphics_get_gtt_base().

Here is the caller graph for this function:

Variable Documentation

◆ __pci_driver

const struct pci_driver graphics_driver __pci_driver
static
Initial value:
= {
.ops = &graphics_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids,
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static const unsigned short pci_device_ids[]
Definition: graphics.c:179
static const struct device_operations graphics_ops
Definition: graphics.c:167

Definition at line 179 of file graphics.c.

◆ graphics_ops

const struct device_operations graphics_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = gma_init,
.ops_pci = &pci_dev_ops_pci,
.scan_bus = scan_generic_bus,
}
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
void scan_generic_bus(struct device *bus)
Definition: root_device.c:52
static void gma_init(struct device *const dev)
Definition: graphics.c:34

Definition at line 159 of file graphics.c.

◆ pci_device_ids

const unsigned short pci_device_ids[]
static

Definition at line 179 of file graphics.c.