xf86-video-intel: 12 commits - configure.ac src/bios_reader/bios_reader.c src/i830_bios.h
Jesse Barnes
jbarnes at kemper.freedesktop.org
Mon Oct 6 16:08:20 PDT 2008
configure.ac | 2
src/bios_reader/bios_reader.c | 86 ++++++++++++++++++---
src/i830_bios.h | 172 +++++++++++++++++++++++++++++++++++++++---
3 files changed, 239 insertions(+), 21 deletions(-)
New commits:
commit 5e04b5ad1b618655e201cbf1f5b2585aa6be0c17
Merge: 979bb10... 260cbcf...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Oct 6 16:08:12 2008 -0700
Merge branch 'master' of ssh://git.freedesktop.org/git/xorg/driver/xf86-video-intel
commit 979bb109c6d76fe18b9e29f55afb2548f890bbfe
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Oct 6 16:05:46 2008 -0700
Document more VBIOS functionality
Document a few more VBT structures and comment on VBIOS communication a
bit. There should be enough there now for a sufficiently motivated
developer to start implementing support for hotkeys and other features
on pre-IGD OpRegion machines.
diff --git a/src/bios_reader/bios_reader.c b/src/bios_reader/bios_reader.c
index 29c3edb..61b492d 100644
--- a/src/bios_reader/bios_reader.c
+++ b/src/bios_reader/bios_reader.c
@@ -165,7 +165,9 @@ static void dump_general_definitions(void)
{
struct bdb_block *block;
struct bdb_general_definitions *defs;
- unsigned char *lvds_data;
+ struct child_device_config *child;
+ int i;
+ char child_id[11];
block = find_section(BDB_GENERAL_DEFINITIONS);
@@ -173,7 +175,6 @@ static void dump_general_definitions(void)
return;
defs = block->data;
- lvds_data = defs->tv_or_lvds_info;
printf("General definitions block:\n");
@@ -185,10 +186,53 @@ static void dump_general_definitions(void)
printf("\tBoot display type: 0x%02x%02x\n", defs->boot_display[1],
defs->boot_display[0]);
printf("\tTV data block present: %s\n", YESNO(tv_present));
- if (tv_present)
- lvds_data += 33;
- if (lvds_present)
- printf("\tLFP DDC GMBUS addr: 0x%02x\n", lvds_data[19]);
+ for (i = 0; i < 4; i++) {
+ child = &defs->devices[i];
+ if (!child->device_type) {
+ printf("\tChild device %d not present\n", i);
+ continue;
+ }
+ strncpy(child_id, (char *)child->device_id, 10);
+ child_id[10] = 0;
+ printf("\tChild %d device info:\n", i);
+ printf("\t\tSignature: %s\n", child_id);
+ printf("\t\tAIM offset: %d\n", child->addin_offset);
+ printf("\t\tDVO port: 0x%02x\n", child->dvo_port);
+ }
+
+ free(block);
+}
+
+static void dump_child_devices(void)
+{
+ struct bdb_block *block;
+ struct bdb_child_devices *child_devs;
+ struct child_device_config *child;
+ int i;
+
+ block = find_section(BDB_CHILD_DEVICE_TABLE);
+ if (!block) {
+ printf("No child device table found\n");
+ return;
+ }
+
+ child_devs = block->data;
+
+ printf("Child devices block:\n");
+ for (i = 0; i < DEVICE_CHILD_SIZE; i++) {
+ child = &child_devs->children[i];
+ /* Skip nonexistent children */
+ if (!child->device_type)
+ continue;
+ printf("\tChild device %d\n", i);
+ printf("\t\tType: 0x%04x\n", child->device_type);
+ printf("\t\tDVO port: 0x%02x\n", child->dvo_port);
+ printf("\t\tI2C pin: 0x%02x\n", child->i2c_pin);
+ printf("\t\tSlave addr: 0x%02x\n", child->slave_addr);
+ printf("\t\tDDC pin: 0x%02x\n", child->ddc_pin);
+ printf("\t\tDVO config: 0x%02x\n", child->dvo_cfg);
+ printf("\t\tDVO wiring: 0x%02x\n", child->dvo_wiring);
+ }
free(block);
}
@@ -199,9 +243,10 @@ static void dump_lvds_options(void)
struct bdb_lvds_options *options;
block = find_section(BDB_LVDS_OPTIONS);
-
- if (!block)
+ if (!block) {
+ printf("No LVDS options block\n");
return;
+ }
options = block->data;
@@ -228,8 +273,10 @@ static void dump_lvds_ptr_data(void)
struct lvds_fp_timing *fp_timing;
block = find_section(BDB_LVDS_LFP_DATA_PTRS);
- if (!block)
+ if (!block) {
+ printf("No LFP data pointers block\n");
return;
+ }
ptrs = block->data;
fp_timing = (struct lvds_fp_timing *)((uint8_t *)bdb +
@@ -252,8 +299,10 @@ static void dump_lvds_data(void)
int i;
block = find_section(BDB_LVDS_LFP_DATA);
- if (!block)
+ if (!block) {
+ printf("No LVDS data block\n");
return;
+ }
lvds_data = block->data;
num_entries = block->size / sizeof(struct bdb_lvds_lfp_data_entry);
@@ -305,6 +354,8 @@ int main(int argc, char **argv)
int vbt_off, bdb_off, i;
char *filename = "bios";
struct stat finfo;
+ struct bdb_block *block;
+ char signature[17];
if (argc != 2) {
printf("usage: %s <rom file>\n", argv[0]);
@@ -348,11 +399,24 @@ int main(int argc, char **argv)
bdb_off = vbt_off + vbt->bdb_offset;
bdb = (struct bdb_header *)(pI830->VBIOS + bdb_off);
- printf("BDB sig: %16s\n", bdb->signature);
+ strncpy(signature, (char *)bdb->signature, 16);
+ signature[16] = 0;
+ printf("BDB sig: %s\n", signature);
printf("BDB vers: %d.%d\n", bdb->version / 100, bdb->version % 100);
+ printf("Available sections: ");
+ for (i = 0; i < 256; i++) {
+ block = find_section(i);
+ if (!block)
+ continue;
+ printf("%d ", i);
+ free(block);
+ }
+ printf("\n");
+
dump_general_features();
dump_general_definitions();
+// dump_child_devices();
dump_lvds_options();
dump_lvds_data();
dump_lvds_ptr_data();
diff --git a/src/i830_bios.h b/src/i830_bios.h
index 6c8bd93..0a1f4ba 100644
--- a/src/i830_bios.h
+++ b/src/i830_bios.h
@@ -117,9 +117,96 @@ struct bdb_general_features {
unsigned char rsvd11:6; /* finish byte */
} __attribute__((packed));
+#define GPIO_PIN_NONE 0x00 /* "N/A" */
+#define GPIO_PIN_I2C 0x01 /* "I2C GPIO pins" */
+#define GPIO_PIN_CRT_DDC 0x02 /* "Analog CRT DDC GPIO pins" */
+/* 915+ */
+#define GPIO_PIN_LVDS 0x03 /* "Integrated LVDS DDC GPIO pins" */
+#define GPIO_PIN_SDVO_I2C 0x05 /* "sDVO I2C GPIO pins" */
+#define GPIO_PIN_SDVO_DDC1 0x1D /* "SDVO DDC1 GPIO pins" */
+#define GPIO_PIN_SDVO_DDC2 0x2D /* "SDVO DDC2 GPIO pins" */
+/* pre-915 */
+#define GPIO_PIN_DVI_LVDS 0x03 /* "DVI/LVDS DDC GPIO pins" */
+#define GPIO_PIN_ADD_I2C 0x05 /* "ADDCARD I2C GPIO pins" */
+#define GPIO_PIN_ADD_DDC 0x04 /* "ADDCARD DDC GPIO pins" */
+#define GPIO_PIN_ADD_DDC_I2C 0x06 /* "ADDCARD DDC/I2C GPIO pins" */
+
+/* Pre 915 */
+#define DEVICE_TYPE_NONE 0x00
+#define DEVICE_TYPE_CRT 0x01
+#define DEVICE_TYPE_TV 0x09
+#define DEVICE_TYPE_EFP 0x12
+#define DEVICE_TYPE_LFP 0x22
+/* On 915+ */
+#define DEVICE_TYPE_CRT_DPMS 0x6001
+#define DEVICE_TYPE_CRT_DPMS_HOTPLUG 0x4001
+#define DEVICE_TYPE_TV_COMPOSITE 0x0209
+#define DEVICE_TYPE_TV_MACROVISION 0x0289
+#define DEVICE_TYPE_TV_RF_COMPOSITE 0x020c
+#define DEVICE_TYPE_TV_SVIDEO_COMPOSITE 0x0609
+#define DEVICE_TYPE_TV_SCART 0x0209
+#define DEVICE_TYPE_TV_CODEC_HOTPLUG_PWR 0x6009
+#define DEVICE_TYPE_EFP_HOTPLUG_PWR 0x6012
+#define DEVICE_TYPE_EFP_DVI_HOTPLUG_PWR 0x6052
+#define DEVICE_TYPE_EFP_DVI_I 0x6053
+#define DEVICE_TYPE_EFP_DVI_D_DUAL 0x6152
+#define DEVICE_TYPE_EFP_DVI_D_HDCP 0x60d2
+#define DEVICE_TYPE_OPENLDI_HOTPLUG_PWR 0x6062
+#define DEVICE_TYPE_OPENLDI_DUALPIX 0x6162
+#define DEVICE_TYPE_LFP_PANELLINK 0x5012
+#define DEVICE_TYPE_LFP_CMOS_PWR 0x5042
+#define DEVICE_TYPE_LFP_LVDS_PWR 0x5062
+#define DEVICE_TYPE_LFP_LVDS_DUAL 0x5162
+#define DEVICE_TYPE_LFP_LVDS_DUAL_HDCP 0x51e2
+
+#define DEVICE_CFG_NONE 0x00
+#define DEVICE_CFG_12BIT_DVOB 0x01
+#define DEVICE_CFG_12BIT_DVOC 0x02
+#define DEVICE_CFG_24BIT_DVOBC 0x09
+#define DEVICE_CFG_24BIT_DVOCB 0x0a
+#define DEVICE_CFG_DUAL_DVOB 0x11
+#define DEVICE_CFG_DUAL_DVOC 0x12
+#define DEVICE_CFG_DUAL_DVOBC 0x13
+#define DEVICE_CFG_DUAL_LINK_DVOBC 0x19
+#define DEVICE_CFG_DUAL_LINK_DVOCB 0x1a
+
+#define DEVICE_WIRE_NONE 0x00
+#define DEVICE_WIRE_DVOB 0x01
+#define DEVICE_WIRE_DVOC 0x02
+#define DEVICE_WIRE_DVOBC 0x03
+#define DEVICE_WIRE_DVOBB 0x05
+#define DEVICE_WIRE_DVOCC 0x06
+#define DEVICE_WIRE_DVOB_MASTER 0x0d
+#define DEVICE_WIRE_DVOC_MASTER 0x0e
+
+#define DEVICE_PORT_DVOA 0x00 /* none on 845+ */
+#define DEVICE_PORT_DVOB 0x01
+#define DEVICE_PORT_DVOC 0x02
+
+struct child_device_config {
+ uint16_t handle;
+ uint16_t device_type; /* See DEVICE_TYPE_* above */
+ uint8_t device_id[10];
+ uint16_t addin_offset;
+ uint8_t dvo_port; /* See DEVICE_PORT_* above */
+ uint8_t i2c_pin;
+ uint8_t slave_addr;
+ uint8_t ddc_pin;
+ uint16_t edid_ptr;
+ uint8_t dvo_cfg; /* See DEVICE_CFG_* above */
+ uint8_t dvo2_port;
+ uint8_t i2c2_pin;
+ uint8_t slave2_addr;
+ uint8_t ddc2_pin;
+ uint8_t capabilities;
+ uint8_t dvo_wiring; /* See DEVICE_WIRE_* above */
+ uint8_t dvo2_wiring;
+ uint16_t extended_type;
+ uint8_t dvo_function;
+} __attribute__((packed));
+
struct bdb_general_definitions {
- /* DDC GPIO */
- unsigned char crt_ddc_gmbus_pin;
+ unsigned char crt_ddc_gmbus_pin; /* see GPIO_PIN_* above */
/* DPMS bits */
unsigned char dpms_acpi:1;
@@ -131,15 +218,25 @@ struct bdb_general_definitions {
unsigned char boot_display[2];
unsigned char child_dev_size;
- /* device info */
- unsigned char tv_or_lvds_info[33];
- unsigned char dev1[33];
- unsigned char dev2[33];
- unsigned char dev3[33];
- unsigned char dev4[33];
+ /*
+ * Device info:
+ * If TV is present, it'll be at devices[0]
+ * LVDS will be next, either devices[0] or [1], if present
+ * Max total will be 6, but could be as few as 4 if both
+ * TV and LVDS are missing, so be careful when interpreting
+ * [4] and [5].
+ */
+ struct child_device_config devices[6];
/* may be another device block here on some platforms */
} __attribute__((packed));
+#define DEVICE_CHILD_SIZE 7
+
+struct bdb_child_devices {
+ uint8_t child_structure_size;
+ struct child_device_config children[DEVICE_CHILD_SIZE];
+} __attribute__((packed));
+
struct bdb_lvds_options {
uint8_t panel_type;
uint8_t rsvd1;
@@ -154,6 +251,16 @@ struct bdb_lvds_options {
uint8_t rsvd4;
} __attribute__((packed));
+/* 915+ only */
+struct bdb_tv_features {
+ /* need to verify bit ordering */
+ uint16_t under_over_scan_via_yprpb:2;
+ uint16_t rsvd1:10;
+ uint16_t under_over_scan_via_dvi:2;
+ uint16_t add_overscan_mode:1;
+ uint16_t rsvd2:1;
+} __attribute__((packed));
+
struct lvds_fp_timing {
uint16_t x_res;
uint16_t y_res;
@@ -223,6 +330,40 @@ struct bdb_lvds_lfp_data {
struct bdb_lvds_lfp_data_entry data[16];
} __attribute__((packed));
+#define BACKLIGHT_TYPE_NONE 0
+#define BACKLIGHT_TYPE_I2C 1
+#define BACKLIGHT_TYPE_PWM 2
+
+#define BACKLIGHT_GMBUS_100KHZ 0
+#define BACKLIGHT_GMBUS_50KHZ 1
+#define BACKLIGHT_GMBUS_400KHZ 2
+#define BACKLIGHT_GMBUS_1MHZ 3
+
+struct backlight_info {
+ uint8_t inverter_type:2; /* see BACKLIGHT_TYPE_* above */
+ uint8_t inverter_polarity:1; /* 1 means 0 is max, 255 is min */
+ uint8_t gpio_pins:3; /* see GPIO_PIN_* above */
+ uint8_t gmbus_speed:2;
+ uint16_t pwm_frequency; /* in Hz */
+ uint8_t min_brightness;
+ /* Next two are only for 915+ systems */
+ uint8_t i2c_addr;
+ uint8_t i2c_cmd;
+} __attribute((packed));
+
+struct bdb_backlight_control {
+ uint8_t row_size;
+ struct backlight_info lfps[16];
+} __attribute__((packed));
+
+struct bdb_bia {
+ uint8_t bia_enable:1;
+ uint8_t bia_level:3;
+ uint8_t rsvd1:3;
+ uint8_t als_enable:1;
+ uint8_t als_response_data[20];
+} __attribute((packed));
+
struct aimdb_header {
char signature[16];
char oem_device[20];
@@ -257,6 +398,19 @@ int i830_bios_init(ScrnInfoPtr pScrn);
/*
* Driver<->VBIOS interaction occurs through scratch bits in
* GR18 & SWF*.
+ *
+ * The VBIOS/firmware will signal to the gfx driver through the ASLE interrupt
+ * (visible in the interupt regs at bit 0) when it wants something done.
+ *
+ * Pre-965:
+ * The gfx driver can make calls to the VBIOS/firmware through an SMI request,
+ * generated by writing to offset 0xe0 of the device's config space (see the
+ * publically available 915 PRM for details).
+ *
+ * 965 and above:
+ * IGD OpRegion requests to the VBIOS/firmware are made using SWSCI, which can
+ * be triggered by writing to offset 0xe4 (see the publically available
+ * 965 graphics PRM for details).
*/
/* GR18 bits are set on display switch and hotkey events */
@@ -335,7 +489,7 @@ int i830_bios_init(ScrnInfoPtr pScrn);
#define SWF14_GFX_PFIT_EN (1<<31)
#define SWF14_TEXT_PFIT_EN (1<<30)
-#define SWF14_LID_STATUS_CLOSED (1<<29) /* 0 here means open */
+#define SWF14_LID_SWITCH_EN (1<<29)
#define SWF14_POPUP_EN (1<<28)
#define SWF14_DISPLAY_HOLDOFF (1<<27)
#define SWF14_DISP_DETECT_EN (1<<26)
commit ffcbbb071f1cde90fe0dc4887a05dd66c0e66985
Merge: 1eb46d0... bf8a3ff...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Tue Sep 30 16:59:35 2008 -0700
Merge branch 'master' into xf86-video-intel-2.5-branch
commit 1eb46d055b147941fa529ac582c336a114f47892
Merge: 8408995... 497b742...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Tue Sep 30 12:54:27 2008 -0700
Merge branch 'master' into xf86-video-intel-2.5-branch
commit 8408995ffbf705aa0bc09ab72c58c2e31a4b70c3
Merge: d18b86a... afa630b...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Sep 22 18:38:54 2008 -0700
Merge branch 'master' into xf86-video-intel-2.5-branch
commit d18b86aa7fc9270e24ed9ea861ebbbbb54558fee
Merge: 9a7da65... 6a46022...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Sep 22 18:03:39 2008 -0700
Merge branch 'master' into xf86-video-intel-2.5-branch
commit 9a7da65e624060a37eef989963a9c79f13df30d3
Merge: 043b6e7... 2f93cfb...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Sep 22 09:59:52 2008 -0700
Merge branch 'master' into xf86-video-intel-2.5-branch
commit 043b6e71b83eb05339a6f8c4814e6941f8b9695a
Author: Xiang, Haihao <haihao.xiang at intel.com>
Date: Tue Sep 16 13:21:43 2008 -0700
Move bufmgr init earlier so it's available at I830DRIDoMappings time.
Fixes a crash with non-GEM mode. Bug #17540.
(cherry picked from commit 62b75df84c893bf28e20014cf88ce45064611dc9)
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5e505cf..9bf0a64 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3254,6 +3254,14 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
#endif
+ if (!pI830->use_drm_mode) {
+ DPRINTF(PFX, "assert( if(!I830MapMem(pScrn)) )\n");
+ if (!I830MapMem(pScrn))
+ return FALSE;
+ pScrn->memPhysBase = (unsigned long)pI830->FbBase;
+ }
+ i830_init_bufmgr(pScrn);
+
#ifdef XF86DRI
/*
* Setup DRI after visuals have been established, but before fbScreenInit
@@ -3287,13 +3295,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pI830->allowPageFlip ? "en" : "dis");
#endif
- if (!pI830->use_drm_mode) {
- DPRINTF(PFX, "assert( if(!I830MapMem(pScrn)) )\n");
- if (!I830MapMem(pScrn))
- return FALSE;
- pScrn->memPhysBase = (unsigned long)pI830->FbBase;
- }
-
if (I830IsPrimary(pScrn)) {
pScrn->fbOffset = pI830->front_buffer->offset;
} else {
@@ -3311,8 +3312,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
- i830_init_bufmgr(pScrn);
-
i830_disable_render_standby(pScrn);
DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n");
commit 0a2d17f7c2ea9b695df1855aab4ccc519546d8e5
Author: Xiang, Haihao <haihao.xiang at intel.com>
Date: Tue Sep 16 11:49:39 2008 -0700
Put back check for pI830->hw_status in setting hws in non-GEM mode.
Fixes crashes on non-GEM systems with physical hardware status page.
Bug #17540
(cherry picked from commit 188d58dac9a87b56dbc34ec219cd196928bbcf64)
diff --git a/src/i830_driver.c b/src/i830_driver.c
index e48e20e..5e505cf 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3693,7 +3693,7 @@ I830EnterVT(int scrnIndex, int flags)
* operation which accessing that page, like irq install, etc.
*/
if (pI830->starting && !pI830->memory_manager) {
- if (!I830DRISetHWS(pScrn)) {
+ if (pI830->hw_status != NULL && !I830DRISetHWS(pScrn)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Fail to setup hardware status page.\n");
I830DRICloseScreen(pScrn->pScreen);
commit 95b3e3a65a60aa264fbbfd141df980b534005264
Merge: 94a86fa... ec17c88...
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Fri Sep 12 13:42:06 2008 -0700
Merge branch 'master' into xf86-video-intel-2.5-branch
Conflicts:
configure.ac - resolved version number conflict
commit 94a86fa51a931f0059ea17728f857ec92cec5b16
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Aug 25 16:59:03 2008 -0700
Fix UXA build for distcheck
Was missing proper path info in CFLAGS.
diff --git a/configure.ac b/configure.ac
index ab1936d..86bb80f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -183,6 +183,8 @@ else
fi
AC_SUBST([XMODES_CFLAGS])
+UXA_CFLAGS='-I$(top_srcdir)/uxa'
+AC_SUBST([UXA_CFLAGS])
SAVE_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
diff --git a/src/Makefile.am b/src/Makefile.am
index 1b1b67c..97feea4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,7 +31,7 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER)
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
- @PCIACCESS_CFLAGS@ -I../uxa \
+ @PCIACCESS_CFLAGS@ @UXA_CFLAGS@ \
@XMODES_CFLAGS@ -DI830_XV -DI830_USE_XAA -DI830_USE_EXA -DI830_USE_UXA
intel_drv_la_LTLIBRARIES = intel_drv.la
commit 09a235af0f216052d3101b153c18be1fa75abf15
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date: Mon Aug 25 16:38:17 2008 -0700
Update version to 2.4.97 for first 2.5 test release
diff --git a/configure.ac b/configure.ac
index e6a2f6f..ab1936d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-intel],
- 2.4.99.0,
+ 2.4.97.0,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
xf86-video-intel)
More information about the xorg-commit
mailing list