add nouveau graphic driver, add some patches for radeon graphic driver, add some patches for drm/mesa

This commit is contained in:
Stephan Raue
2009-04-26 04:00:40 +02:00
parent c52480a6b7
commit 7acdaf6ea9
30 changed files with 163340 additions and 9 deletions

View File

@@ -119,7 +119,7 @@ WPA_SUPPLICANT=yes
# X.org drivers to use (all/ati/geode/glint/i740/intel/mga/nv/openchrome/
# radeonhd/s3/s3virge/savage/sis/tdfx/trident/vesa/vmware)
# Space separated list is supported, e.g. XORG_DRIVERS="ati s3"
XORG_DRIVERS="ati nv vesa openchrome intel"
XORG_DRIVERS="ati nouveau nv vesa openchrome intel"
# LCD display support (yes/no)

View File

@@ -0,0 +1,45 @@
--- configure.ac.mach64 2008-09-05 13:53:24.000000000 +1000
+++ configure.ac 2008-09-05 13:53:39.000000000 +1000
@@ -656,7 +656,7 @@
# because there is no x86-64 system where they could *ever*
# be used.
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="i915 i965 mach64 mga r128 r200 r300 radeon \
+ DRI_DIRS="i915 i965 mga r128 r200 r300 radeon \
savage tdfx unichrome swrast"
fi
;;
@@ -664,13 +664,13 @@
# Build only the drivers for cards that exist on PowerPC.
# At some point MGA will be added, but not yet.
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="mach64 r128 r200 r300 radeon tdfx swrast"
+ DRI_DIRS="r128 r200 r300 radeon tdfx swrast"
fi
;;
sparc*)
# Build only the drivers for cards that exist on sparc`
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="mach64 r128 r200 r300 radeon ffb swrast"
+ DRI_DIRS="r128 r200 r300 radeon ffb swrast"
fi
;;
esac
@@ -689,7 +689,7 @@
# ffb and gamma are missing because they have not been converted
# to use the new interface.
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon tdfx \
+ DRI_DIRS="i810 i915 i965 mga r128 r200 r300 radeon tdfx \
unichrome savage sis swrast"
fi
;;
@@ -704,7 +704,7 @@
# default drivers
if test "x$DRI_DIRS" = "xyes"; then
- DRI_DIRS="i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
+ DRI_DIRS="i810 i915 i965 mga r128 r200 r300 radeon s3v \
savage sis tdfx trident unichrome ffb swrast"
fi

File diff suppressed because it is too large Load Diff

View File

@@ -11,9 +11,10 @@ $SCRIPTS/install libXxf86vm
$SCRIPTS/install libX11
mkdir -p $INSTALL/usr/lib
cp -PR $BUILD/$1*/src/mesa/libmesa.so* $INSTALL/usr/lib
#cp -PR $BUILD/$1*/src/mesa/libmesa.so* $INSTALL/usr/lib
#cp -PR $BUILD/$1*/src/mesa/libglapi.so* $INSTALL/usr/lib
cp -PR $BUILD/$1*/lib/libGL.so* $INSTALL/usr/lib
cp -PR $BUILD/$1*/lib/libdricore.so $INSTALL/usr/lib
#cp -PR $BUILD/$1*/lib/libGLU.so* $INSTALL/usr/lib
mkdir -p $INSTALL/usr/lib/dri

View File

@@ -0,0 +1,21 @@
diff -up Mesa-7.1/src/mesa/drivers/osmesa/Makefile.jx Mesa-7.1/src/mesa/drivers/osmesa/Makefile
--- Mesa-7.1/src/mesa/drivers/osmesa/Makefile.jx 2008-08-28 14:05:47.000000000 -0400
+++ Mesa-7.1/src/mesa/drivers/osmesa/Makefile 2008-08-28 14:07:13.000000000 -0400
@@ -46,7 +46,7 @@ osmesa8: $(TOP)/lib/$(OSMESA_LIB_NAME)
$(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS)
$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+ -major 6 -minor 5 -patch 3 \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \
$(OSMESA_LIB_DEPS) $(OBJECTS)
@@ -58,7 +58,7 @@ $(TOP)/lib/$(OSMESA_LIB_NAME): $(OBJECTS
# with all the other Mesa sources (compiled with -DCHAN_BITS=16/32
osmesa16: $(OBJECTS) $(CORE_MESA)
$(MKLIB) -o $(OSMESA_LIB) -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- -major $(MESA_MAJOR) -minor $(MESA_MINOR) -patch $(MESA_TINY) \
+ -major 6 -minor 5 -patch 3 \
-install $(TOP)/$(LIB_DIR) $(MKLIB_OPTIONS) \
-id $(INSTALL_LIB_DIR)/lib$(OSMESA_LIB).$(MESA_MAJOR).dylib \
$(OSMESA_LIB_DEPS) $(OBJECTS) $(CORE_MESA)

View File

@@ -0,0 +1,15 @@
diff -up Mesa-7.1/src/mesa/drivers/dri/intel/intel_fbo.c.intel-glthread Mesa-7.1/src/mesa/drivers/dri/intel/intel_fbo.c
--- Mesa-7.1/src/mesa/drivers/dri/intel/intel_fbo.c.intel-glthread 2008-08-25 10:49:40.000000000 -0400
+++ Mesa-7.1/src/mesa/drivers/dri/intel/intel_fbo.c 2008-08-28 14:26:17.000000000 -0400
@@ -633,11 +633,6 @@ intel_render_texture(GLcontext * ctx,
return;
}
- DBG("Begin render texture tid %x tex=%u w=%d h=%d refcount=%d\n",
- _glthread_GetID(),
- att->Texture->Name, newImage->Width, newImage->Height,
- irb->Base.RefCount);
-
/* point the renderbufer's region to the texture image region */
intel_image = intel_texture_image(newImage);
if (irb->region != intel_image->mt->region) {

View File

@@ -0,0 +1,102 @@
diff -Naur Mesa-7.4.1/src/mesa/drivers/dri/Makefile Mesa-7.4.1.patch/src/mesa/drivers/dri/Makefile
--- Mesa-7.4.1/src/mesa/drivers/dri/Makefile 2009-03-13 04:28:49.000000000 +0100
+++ Mesa-7.4.1.patch/src/mesa/drivers/dri/Makefile 2009-04-25 22:26:13.000000000 +0200
@@ -6,12 +6,16 @@
-default: $(TOP)/$(LIB_DIR) subdirs
-
+default: $(TOP)/$(LIB_DIR) $(TOP)/$(LIB_DIR)/libdricore.so subdirs
$(TOP)/$(LIB_DIR):
-mkdir $(TOP)/$(LIB_DIR)
+libdricore.so:
+ $(CC) -shared -o libdricore.so -Wl,--whole-archive ../../libmesa.a -Wl,--no-whole-archive -lm -lpthread -lc
+
+$(TOP)/$(LIB_DIR)/libdricore.so: $(TOP)/$(LIB_DIR) libdricore.so
+ $(INSTALL) libdricore.so $(TOP)/$(LIB_DIR)
subdirs:
@for dir in $(DRI_DIRS) ; do \
@@ -32,12 +36,14 @@
$(pcedit) $< > $@
-install: dri.pc
+install: dri.pc $(TOP)/$(LIB_DIR)/libdricore.so
@for dir in $(DRI_DIRS) ; do \
if [ -d $$dir ] ; then \
(cd $$dir && $(MAKE) install) || exit 1 ; \
fi \
done
+ $(INSTALL) -d $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
+ $(INSTALL) -m 755 $(TOP)/$(LIB_DIR)/libdricore.so $(DESTDIR)$(DRI_DRIVER_INSTALL_DIR)
$(INSTALL) -d $(DESTDIR)$(INSTALL_INC_DIR)/GL/internal
$(INSTALL) -m 0644 $(TOP)/include/GL/internal/dri_interface.h \
$(DESTDIR)$(INSTALL_INC_DIR)/GL/internal
@@ -51,5 +57,6 @@
(cd $$dir && $(MAKE) clean) ; \
fi \
done
+ -rm -f libdricore.so $(TOP)/$(LIB_DIR)/libdricore.so
-rm -f common/*.o
-rm -f *.pc
diff -Naur Mesa-7.4.1/src/mesa/drivers/dri/Makefile.template Mesa-7.4.1.patch/src/mesa/drivers/dri/Makefile.template
--- Mesa-7.4.1/src/mesa/drivers/dri/Makefile.template 2009-03-13 04:28:49.000000000 +0100
+++ Mesa-7.4.1.patch/src/mesa/drivers/dri/Makefile.template 2009-04-25 22:22:59.000000000 +0200
@@ -1,6 +1,6 @@
# -*-makefile-*-
-MESA_MODULES = $(TOP)/src/mesa/libmesa.a
+MESA_MODULES = $(TOP)/$(LIB_DIR)/libdricore.so
COMMON_SOURCES = \
../common/utils.c \
@@ -61,7 +61,9 @@
$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template
$(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \
- $(OBJECTS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS)
+ $(OBJECTS) $(WINOBJ) \
+ -L$(TOP)/$(LIB_DIR) -Wl,-R$(DRI_DRIVER_INSTALL_DIR) -ldricore \
+ $(DRI_LIB_DEPS)
$(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME)
diff -Naur Mesa-7.4.1/src/mesa/x86/read_rgba_span_x86.S Mesa-7.4.1.patch/src/mesa/x86/read_rgba_span_x86.S
--- Mesa-7.4.1/src/mesa/x86/read_rgba_span_x86.S 2008-08-25 16:46:47.000000000 +0200
+++ Mesa-7.4.1.patch/src/mesa/x86/read_rgba_span_x86.S 2009-04-25 22:20:15.000000000 +0200
@@ -77,7 +77,6 @@
*/
.globl _generic_read_RGBA_span_BGRA8888_REV_MMX
-.hidden _generic_read_RGBA_span_BGRA8888_REV_MMX
.type _generic_read_RGBA_span_BGRA8888_REV_MMX, @function
_generic_read_RGBA_span_BGRA8888_REV_MMX:
pushl %ebx
@@ -172,7 +171,6 @@
*/
.globl _generic_read_RGBA_span_BGRA8888_REV_SSE
-.hidden _generic_read_RGBA_span_BGRA8888_REV_SSE
.type _generic_read_RGBA_span_BGRA8888_REV_SSE, @function
_generic_read_RGBA_span_BGRA8888_REV_SSE:
pushl %esi
@@ -335,7 +333,6 @@
.text
.globl _generic_read_RGBA_span_BGRA8888_REV_SSE2
-.hidden _generic_read_RGBA_span_BGRA8888_REV_SSE2
.type _generic_read_RGBA_span_BGRA8888_REV_SSE2, @function
_generic_read_RGBA_span_BGRA8888_REV_SSE2:
pushl %esi
@@ -494,7 +491,6 @@
.text
.globl _generic_read_RGBA_span_RGB565_MMX
- .hidden _generic_read_RGBA_span_RGB565_MMX
.type _generic_read_RGBA_span_RGB565_MMX, @function
_generic_read_RGBA_span_RGB565_MMX:

View File

@@ -0,0 +1,21 @@
commit 532d2051245a1d8afe7ca236f1d966d555bb121a
Author: Dave Airlie <airlied@linux.ie>
Date: Fri Sep 12 17:21:25 2008 +1000
Revert "intel: sync to vblank by default"
This reverts commit e9bf3e4cc9a7e4bcd4c45bd707541d26ecdf0409.
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index c193830..f02192d 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -55,7 +55,7 @@ PUBLIC const char __driConfigOptions[] =
DRI_CONF_BEGIN
DRI_CONF_SECTION_PERFORMANCE
DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
- DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_ALWAYS_SYNC)
+ DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
/* Options correspond to DRI_CONF_BO_REUSE_DISABLED,
* DRI_CONF_BO_REUSE_ALL
*/

View File

@@ -0,0 +1,15 @@
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c
index cf09fad..572a28b 100644
--- a/src/mesa/drivers/dri/intel/intel_screen.c
+++ b/src/mesa/drivers/dri/intel/intel_screen.c
@@ -583,8 +583,8 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen)
if (gem_disable) {
fprintf(stderr, "GEM disabled. Using classic.\n");
} else {
- fprintf(stderr, "Failed to initialize GEM. "
- "Falling back to classic.\n");
+// fprintf(stderr, "Failed to initialize GEM. "
+// "Falling back to classic.\n");
}
if (intelScreen->tex.size == 0) {

File diff suppressed because it is too large Load Diff

View File

@@ -1196,11 +1196,11 @@ CONFIG_HPET_MMAP=y
# CONFIG_TCG_TPM is not set
# CONFIG_TELCLOCK is not set
CONFIG_DEVPORT=y
CONFIG_I2C=m
CONFIG_I2C=y
CONFIG_I2C_BOARDINFO=y
CONFIG_I2C_CHARDEV=m
CONFIG_I2C_HELPER_AUTO=y
CONFIG_I2C_ALGOBIT=m
CONFIG_I2C_ALGOBIT=y
#
# I2C Hardware Bus support
@@ -1386,7 +1386,9 @@ CONFIG_SSB_DRIVER_PCICORE=y
# CONFIG_HTC_PASIC3 is not set
# CONFIG_UCB1400_CORE is not set
# CONFIG_TPS65010 is not set
# CONFIG_TWL4030_CORE is not set
# CONFIG_MFD_TMIO is not set
# CONFIG_PMIC_DA903X is not set
# CONFIG_MFD_WM8400 is not set
# CONFIG_MFD_WM8350_I2C is not set
# CONFIG_MFD_PCF50633 is not set
@@ -1711,7 +1713,7 @@ CONFIG_DAB=y
#
# Graphics support
#
CONFIG_AGP=m
CONFIG_AGP=y
CONFIG_AGP_ALI=m
CONFIG_AGP_ATI=m
CONFIG_AGP_AMD=m
@@ -1722,18 +1724,21 @@ CONFIG_AGP_SIS=m
CONFIG_AGP_SWORKS=m
CONFIG_AGP_VIA=m
CONFIG_AGP_EFFICEON=m
CONFIG_DRM=m
CONFIG_DRM=y
# CONFIG_DRM_TDFX is not set
# CONFIG_DRM_R128 is not set
CONFIG_DRM_RADEON=m
CONFIG_DRM_RADEON_KMS=y
CONFIG_DRM_I810=m
CONFIG_DRM_I830=m
CONFIG_DRM_I915=m
# CONFIG_DRM_I915_KMS is not set
CONFIG_DRM_I915_KMS=y
# CONFIG_DRM_MGA is not set
CONFIG_DRM_SIS=m
# CONFIG_DRM_SIS is not set
CONFIG_DRM_VIA=m
CONFIG_DRM_SAVAGE=m
# CONFIG_DRM_SAVAGE is not set
CONFIG_DRM_NOUVEAU=m
CONFIG_DRM_NOUVEAU_KMS=y
# CONFIG_VGASTATE is not set
CONFIG_VIDEO_OUTPUT_CONTROL=y
CONFIG_FB=y

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
http://lists.freedesktop.org/archives/intel-gfx/2009-February/001313.html
--- a/drivers/gpu/drm/i915/i915_suspend.c.orig 2009-02-18 22:59:19.000000000 -0500
+++ b/drivers/gpu/drm/i915/i915_suspend.c 2009-02-18 22:59:58.000000000 -0500
@@ -28,6 +28,7 @@
#include "drm.h"
#include "i915_drm.h"
#include "i915_drv.h"
+#include <drm/drm_crtc_helper.h>
static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
{
@@ -519,6 +520,8 @@
i915_restore_vga(dev);
+ drm_helper_resume_force_mode(dev);
+
return 0;
}
From f5192bce8be69e5b33d7579bc282fef4d673e2c1 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Sun, 15 Mar 2009 13:55:55 +0100
Subject: [PATCH] Fix i915 nomodeset NULL deref. during PM resume
drm_helper_resume_force_mode() would crash while attempting to
iterate through crtc_list, which is uninitialized when is modesetting
disabled.
---
drivers/gpu/drm/i915/i915_suspend.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index ef5fb6e..b138032 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -520,7 +520,8 @@ int i915_restore_state(struct drm_device *dev)
i915_restore_vga(dev);
- drm_helper_resume_force_mode(dev);
+ if (drm_core_check_feature(dev, DRIVER_MODESET))
+ drm_helper_resume_force_mode(dev);
return 0;
}
--
1.6.2

View File

@@ -0,0 +1,16 @@
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 37427e4..08af9db 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2553,6 +2553,11 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
mutex_lock(&dev->struct_mutex);
+ /* We don't get the flushing right for these chipsets, use the
+ * big hamer for now to avoid random crashiness. */
+ if (IS_I855(dev) || IS_I865G(dev))
+ wbinvd();
+
i915_verify_inactive(dev, __FILE__, __LINE__);
if (dev_priv->mm.wedged) {

View File

@@ -0,0 +1,95 @@
[PATCH] drm: ignore LVDS on intel graphics systems that lie about having it
There are a number of small form factor desktop systems with Intel mobile
graphics chips that lie and say they have an LVDS. With kernel mode-setting,
this becomes a problem, and makes native resolution boot go haywire -- for
example, my Dell Studio Hybrid, hooked to a 1920x1080 display claims to
have a 1024x768 LVDS, and the resulting graphical boot on the 1920x1080
display uses only the top left 1024x768, and auto-configured X will end
up only 1024x768 as well. With this change, graphical boot and X
both do 1920x1080 as expected.
Nb: one minor issue... Current Fedora rawhide, video playback using Xv
makes X go off into the weeds with this patch added... But that's a bug
elsewhere, still confident this patch DTRT.
Signed-off-by: Jarod Wilson <jarod@redhat.com>
---
drivers/gpu/drm/i915/intel_lvds.c | 46 ++++++++++++++++++++++++++++++------
1 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 6619f26..4d64686 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -384,7 +384,51 @@ static const struct drm_encoder_funcs intel_lvds_enc_funcs = {
.destroy = intel_lvds_enc_destroy,
};
+static int __init intel_no_lvds_dmi_callback(const struct dmi_system_id *id)
+{
+ DRM_DEBUG("Skipping LVDS initialization for %s\n", id->ident);
+ return 1;
+}
+/* These systems claim to have LVDS, but really don't */
+static const struct dmi_system_id __initdata intel_no_lvds[] = {
+ {
+ .callback = intel_no_lvds_dmi_callback,
+ .ident = "Apple Mac Mini (Core series)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"),
+ },
+ },
+ {
+ .callback = intel_no_lvds_dmi_callback,
+ .ident = "Apple Mac Mini (Core 2 series)",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Macmini2,1"),
+ },
+ },
+ {
+ .callback = intel_no_lvds_dmi_callback,
+ .ident = "MSI IM-945GSE-A",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "MSI"),
+ DMI_MATCH(DMI_PRODUCT_NAME, "A9830IMS"),
+ },
+ },
+ {
+ .callback = intel_no_lvds_dmi_callback,
+ .ident = "Dell Studio Hybrid",
+ .matches = {
+ DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
+ DMI_MATCH(DMI_PRODUCT_NAME, "Studio Hybrid 140g"),
+ },
+ },
+
+ /* FIXME: add a check for the Aopen Mini PC */
+
+ { } /* terminating entry */
+};
/**
* intel_lvds_init - setup LVDS connectors on this device
@@ -404,15 +440,9 @@ void intel_lvds_init(struct drm_device *dev)
u32 lvds;
int pipe;
- /* Blacklist machines that we know falsely report LVDS. */
- /* FIXME: add a check for the Aopen Mini PC */
-
- /* Apple Mac Mini Core Duo and Mac Mini Core 2 Duo */
- if(dmi_match(DMI_PRODUCT_NAME, "Macmini1,1") ||
- dmi_match(DMI_PRODUCT_NAME, "Macmini2,1")) {
- DRM_DEBUG("Skipping LVDS initialization for Apple Mac Mini\n");
+ /* Skip init on machines we know falsely report LVDS */
+ if (dmi_check_system(intel_no_lvds))
return;
- }
intel_output = kzalloc(sizeof(struct intel_output), GFP_KERNEL);
if (!intel_output) {

View File

@@ -0,0 +1,14 @@
diff -up linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c.jx linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c
--- linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c.jx 2009-04-09 13:42:51.000000000 -0400
+++ linux-2.6.29.noarch/drivers/gpu/drm/i915/intel_display.c 2009-04-09 13:44:14.000000000 -0400
@@ -2011,8 +2011,8 @@ void intel_modeset_init(struct drm_devic
dev->mode_config.max_width = 8192;
dev->mode_config.max_height = 8192;
} else {
- dev->mode_config.max_width = 2048;
- dev->mode_config.max_height = 2048;
+ dev->mode_config.max_width = 4096;
+ dev->mode_config.max_height = 4096;
}
/* set memory base */

View File

@@ -0,0 +1,65 @@
From: Jesse Barnes <jbarnes@virtuousgeek.org>
Date: Tue, 14 Apr 2009 21:17:47 +0000 (-0700)
Subject: drm/i915: allow tiled front buffers on 965+
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Fanholt%2Fdrm-intel.git;a=commitdiff_plain;h=f544847fbaf099278343f875987a983f2b913134
drm/i915: allow tiled front buffers on 965+
This patch corrects a pretty big oversight in the KMS code for 965+
chips. The current code is missing tiled surface register programming,
so userland can allocate a tiled surface and use it for mode setting,
resulting in corruption. This patch fixes that, allowing for tiled
front buffers on 965+.
Cc: stable@kernel.org
Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
---
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index e805b59..5211947 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -1446,6 +1446,7 @@
#define DISPPLANE_NO_LINE_DOUBLE 0
#define DISPPLANE_STEREO_POLARITY_FIRST 0
#define DISPPLANE_STEREO_POLARITY_SECOND (1<<18)
+#define DISPPLANE_TILED (1<<10)
#define DSPAADDR 0x70184
#define DSPASTRIDE 0x70188
#define DSPAPOS 0x7018C /* reserved */
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index c2c8e95..bdcda36 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -657,6 +657,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
int dspbase = (pipe == 0 ? DSPAADDR : DSPBADDR);
int dspsurf = (pipe == 0 ? DSPASURF : DSPBSURF);
int dspstride = (pipe == 0) ? DSPASTRIDE : DSPBSTRIDE;
+ int dsptileoff = (pipe == 0 ? DSPATILEOFF : DSPBTILEOFF);
int dspcntr_reg = (pipe == 0) ? DSPACNTR : DSPBCNTR;
u32 dspcntr, alignment;
int ret;
@@ -733,6 +734,13 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
mutex_unlock(&dev->struct_mutex);
return -EINVAL;
}
+ if (IS_I965G(dev)) {
+ if (obj_priv->tiling_mode != I915_TILING_NONE)
+ dspcntr |= DISPPLANE_TILED;
+ else
+ dspcntr &= ~DISPPLANE_TILED;
+ }
+
I915_WRITE(dspcntr_reg, dspcntr);
Start = obj_priv->gtt_offset;
@@ -745,6 +753,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
I915_READ(dspbase);
I915_WRITE(dspsurf, Start);
I915_READ(dspsurf);
+ I915_WRITE(dsptileoff, (y << 16) | x);
} else {
I915_WRITE(dspbase, Start + Offset);
I915_READ(dspbase);

Some files were not shown because too many files have changed in this diff Show More