summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-06-30 16:31:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-06-30 16:31:28 +0100
commitc0434ab49035bf278dad6f5f84a541ea58536fb4 (patch)
tree0cbf98f55544839d4ef86509d0ac2481d6163778
parent18d08e49d270b7a05f14a309759c9315e5ab9679 (diff)
sna: Distinguish 830/845 vs 855/865 using the generation id
Remove the PCI ID device checks by using the simpler check on the generation id for errata pertaining to 830/845. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_module.c21
-rw-r--r--src/sna/gen2_render.c4
-rw-r--r--src/sna/sna_video.c2
-rw-r--r--src/sna/sna_video_overlay.c4
4 files changed, 20 insertions, 11 deletions
diff --git a/src/intel_module.c b/src/intel_module.c
index f6561bf3..499814eb 100644
--- a/src/intel_module.c
+++ b/src/intel_module.c
@@ -46,9 +46,18 @@ static const struct intel_device_info intel_i81x_info = {
.gen = 10,
};
-static const struct intel_device_info intel_i8xx_info = {
+static const struct intel_device_info intel_i830_info = {
.gen = 20,
};
+static const struct intel_device_info intel_i845_info = {
+ .gen = 20,
+};
+static const struct intel_device_info intel_i855_info = {
+ .gen = 21,
+};
+static const struct intel_device_info intel_i865_info = {
+ .gen = 21,
+};
static const struct intel_device_info intel_i915_info = {
.gen = 30,
@@ -142,11 +151,11 @@ static const struct pci_id_match intel_device_match[] = {
INTEL_DEVICE_MATCH (PCI_CHIP_I810_E, &intel_i81x_info ),
INTEL_DEVICE_MATCH (PCI_CHIP_I815, &intel_i81x_info ),
- INTEL_DEVICE_MATCH (PCI_CHIP_I830_M, &intel_i8xx_info ),
- INTEL_DEVICE_MATCH (PCI_CHIP_845_G, &intel_i8xx_info ),
- INTEL_DEVICE_MATCH (PCI_CHIP_I854, &intel_i8xx_info ),
- INTEL_DEVICE_MATCH (PCI_CHIP_I855_GM, &intel_i8xx_info ),
- INTEL_DEVICE_MATCH (PCI_CHIP_I865_G, &intel_i8xx_info ),
+ INTEL_DEVICE_MATCH (PCI_CHIP_I830_M, &intel_i830_info ),
+ INTEL_DEVICE_MATCH (PCI_CHIP_845_G, &intel_i845_info ),
+ INTEL_DEVICE_MATCH (PCI_CHIP_I854, &intel_i855_info ),
+ INTEL_DEVICE_MATCH (PCI_CHIP_I855_GM, &intel_i855_info ),
+ INTEL_DEVICE_MATCH (PCI_CHIP_I865_G, &intel_i865_info ),
INTEL_DEVICE_MATCH (PCI_CHIP_I915_G, &intel_i915_info ),
INTEL_DEVICE_MATCH (PCI_CHIP_E7221_G, &intel_i915_info ),
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 34c053b1..06cab3c1 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -161,7 +161,7 @@ gen2_get_card_format(struct sna *sna, uint32_t format)
if (i8xx_tex_formats[i].fmt == format)
return i8xx_tex_formats[i].card_fmt;
- if (IS_I830(sna) || IS_845G(sna)) {
+ if (sna->kgem.gen < 21) {
/* Whilst these are not directly supported on 830/845,
* we only enable them when we can implicitly convert
* them to a supported variant through the texture
@@ -969,7 +969,7 @@ gen2_check_card_format(struct sna *sna,
for (i = 0; i < ARRAY_SIZE(i85x_tex_formats); i++) {
if (i85x_tex_formats[i].fmt == format) {
- if (!(IS_I830(sna) || IS_845G(sna)))
+ if (sna->kgem.gen >= 21)
return TRUE;
if ( source_is_covered(picture, x, y, w,h)) {
diff --git a/src/sna/sna_video.c b/src/sna/sna_video.c
index c0b1451d..e50b3dd9 100644
--- a/src/sna/sna_video.c
+++ b/src/sna/sna_video.c
@@ -196,7 +196,7 @@ sna_video_frame_init(struct sna *sna,
* stride must be at least 512 bytes. Take the easy fix
* and align on 512 bytes unconditionally. */
align = 512;
- else if (IS_I830(sna) || IS_845G(sna))
+ else if (sna->kgem.gen < 21)
/* Harsh, errata on these chipsets limit the stride
* to be a multiple of 256 bytes.
*/
diff --git a/src/sna/sna_video_overlay.c b/src/sna/sna_video_overlay.c
index c4838c2d..422ce53d 100644
--- a/src/sna/sna_video_overlay.c
+++ b/src/sna/sna_video_overlay.c
@@ -540,7 +540,7 @@ sna_video_overlay_query_video_attributes(ScrnInfoPtr scrn,
DBG(("%s: w is %d, h is %d\n", __FUNCTION__, *w, *h));
- if (IS_845G(sna) || IS_I830(sna)) {
+ if (sna->kgem.gen < 21) {
if (*w > IMAGE_MAX_WIDTH_LEGACY)
*w = IMAGE_MAX_WIDTH_LEGACY;
if (*h > IMAGE_MAX_HEIGHT_LEGACY)
@@ -651,7 +651,7 @@ XF86VideoAdaptorPtr sna_video_overlay_setup(struct sna *sna,
adaptor->nEncodings = 1;
adaptor->pEncodings = xnfalloc(sizeof(DummyEncoding));
memcpy(adaptor->pEncodings, DummyEncoding, sizeof(DummyEncoding));
- if (IS_845G(sna) || IS_I830(sna)) {
+ if (sna->kgem.gen < 21) {
adaptor->pEncodings->width = IMAGE_MAX_WIDTH_LEGACY;
adaptor->pEncodings->height = IMAGE_MAX_HEIGHT_LEGACY;
}