xserver-xorg-video-modesetting: Changes to 'upstream-experimental'
autogen.sh | 4 +-
configure.ac | 2 -
src/driver.c | 71 +++++++++++++++++++++++---------------
src/drmmode_display.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++--
src/drmmode_display.h | 2 -
5 files changed, 140 insertions(+), 32 deletions(-)
New commits:
commit 58d3dc53a89c5aa2acfc93e4ae5719dd92b785b9
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Wed Jun 12 14:11:53 2013 +0200
bump to 0.8.0
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
diff --git a/configure.ac b/configure.ac
index f0c267f..6f7a7be 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-modesetting],
- [0.7.0],
+ [0.8.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-modesetting])
AC_CONFIG_SRCDIR([Makefile.am])
commit a299400b8404f935e5e2bc6a5b9c17821844bd0d
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Wed Jun 12 14:05:19 2013 +0200
modesetting: probe only succeeds if connectors are detected
This will prevent modesetting being used for outputless intel or nvidia cards.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
diff --git a/src/driver.c b/src/driver.c
index c3d78be..cc526f6 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -201,12 +201,25 @@ static int open_hw(char *dev)
return fd;
}
+static int check_outputs(int fd)
+{
+ drmModeResPtr res = drmModeGetResources(fd);
+ int ret;
+
+ if (!res)
+ return FALSE;
+ ret = res->count_connectors > 0;
+ drmModeFreeResources(res);
+ return ret;
+}
+
static Bool probe_hw(char *dev)
{
int fd = open_hw(dev);
if (fd != -1) {
+ int ret = check_outputs(fd);
close(fd);
- return TRUE;
+ return ret;
}
return FALSE;
}
@@ -226,7 +239,7 @@ ms_DRICreatePCIBusID(const struct pci_device *dev)
static Bool probe_hw_pci(char *dev, struct pci_device *pdev)
{
- int fd = open_hw(dev);
+ int ret = FALSE, fd = open_hw(dev);
char *id, *devid;
drmSetVersion sv;
@@ -247,13 +260,12 @@ static Bool probe_hw_pci(char *dev, struct pci_device *pdev)
devid = ms_DRICreatePCIBusID(pdev);
close(fd);
- if (!id || !devid)
- return FALSE;
-
- if (!strcmp(id, devid))
- return TRUE;
+ if (id && devid && !strcmp(id, devid))
+ ret = check_outputs(fd);
- return FALSE;
+ free(id);
+ free(devid);
+ return ret;
}
static const OptionInfoRec *
AvailableOptions(int chipid, int busid)
commit a62d5e60896166be88fcf3778921b8d10baec2c1
Author: Dave Airlie <airlied@redhat.com>
Date: Tue Jun 11 10:29:25 2013 +1000
modesetting: fix adjust frame crash
When SDL called this it was totally broken, actually hook
up to the underlying drmmode function.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64808
Thanks to Peter Wu <lekensteyn@gmail.com> for harassing me.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/driver.c b/src/driver.c
index 742aadd..c3d78be 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -956,16 +956,9 @@ static void
AdjustFrame(ADJUST_FRAME_ARGS_DECL)
{
SCRN_INFO_PTR(arg);
- xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
- xf86OutputPtr output = config->output[config->compat_output];
- xf86CrtcPtr crtc = output->crtc;
-
- if (crtc && crtc->enabled) {
- crtc->funcs->mode_set(crtc, pScrn->currentMode, pScrn->currentMode, x,
- y);
- crtc->x = output->initial_x + x;
- crtc->y = output->initial_y + y;
- }
+ modesettingPtr ms = modesettingPTR(pScrn);
+
+ drmmode_adjust_frame(pScrn, &ms->drmmode, x, y);
}
static void
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2dc7576..ce90cea 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1267,7 +1267,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp)
return TRUE;
}
-void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y, int flags)
+void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y)
{
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
xf86OutputPtr output = config->output[config->compat_output];
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 1d5522b..adf4b99 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -118,7 +118,7 @@ Bool drmmode_SetSlaveBO(PixmapPtr ppix,
#endif
extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int cpp);
-void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y, int flags);
+void drmmode_adjust_frame(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int x, int y);
extern Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode);
extern Bool drmmode_setup_colormap(ScreenPtr pScreen, ScrnInfoPtr pScrn);
commit cba29fd8c2f605ed66718aa3a6b5833deb5d4cf9
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Wed Apr 3 12:08:44 2013 +0200
support 32 bpp pixmaps when 24 bpp fb is used.
Fixes background corruption in ubuntu.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
diff --git a/src/driver.c b/src/driver.c
index 06d6d53..742aadd 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -650,7 +650,7 @@ PreInit(ScrnInfoPtr pScrn, int flags)
#endif
drmmode_get_default_bpp(pScrn, &ms->drmmode, &defaultdepth, &defaultbpp);
if (defaultdepth == 24 && defaultbpp == 24)
- bppflags = Support24bppFb;
+ bppflags = SupportConvert32to24 | Support24bppFb;
else
bppflags = PreferConvert24to32 | SupportConvert24to32 | Support32bppFb;
commit 332fbe8e13502c11bf32353123cba5e1e1bf3796
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Wed Mar 27 10:33:46 2013 +0100
bump version to 0.7.0
diff --git a/configure.ac b/configure.ac
index 562249e..f0c267f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
AC_INIT([xf86-video-modesetting],
- [0.6.0],
+ [0.7.0],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xf86-video-modesetting])
AC_CONFIG_SRCDIR([Makefile.am])
commit 3c631228a9f57e73ee693d5283894db1a460e0a4
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Mar 26 15:19:52 2013 +0100
modesetting: return null for get_modes if output could not be retrieved
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e8ebef1..2dc7576 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -709,6 +709,9 @@ drmmode_output_get_modes(xf86OutputPtr output)
drmModePropertyPtr props;
xf86MonPtr mon = NULL;
+ if (!koutput)
+ return NULL;
+
/* look for an EDID property */
for (i = 0; i < koutput->count_props; i++) {
props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
commit e5b5297ac449fb4ac62cc6471f933ae2265778a2
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date: Tue Mar 26 15:19:33 2013 +0100
modesetting: clean up leaks
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
diff --git a/src/driver.c b/src/driver.c
index 87ba272..06d6d53 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -206,7 +206,7 @@ static Bool probe_hw(char *dev)
int fd = open_hw(dev);
if (fd != -1) {
close(fd);
- return TRUE;
+ return TRUE;
}
return FALSE;
}
@@ -530,15 +530,27 @@ static void msBlockHandler(BLOCKHANDLER_ARGS_DECL)
static void
FreeRec(ScrnInfoPtr pScrn)
{
+ modesettingPtr ms;
+
if (!pScrn)
- return;
+ return;
- if (!pScrn->driverPrivate)
- return;
+ ms = modesettingPTR(pScrn);
+ if (!ms)
+ return;
+ pScrn->driverPrivate = NULL;
- free(pScrn->driverPrivate);
+ if (ms->fd > 0) {
+ int ret;
+
+ if (ms->pEnt->location.type == BUS_PCI)
+ ret = drmClose(ms->fd);
+ else
+ ret = close(ms->fd);
+ }
+ free(ms->Options);
+ free(ms);
- pScrn->driverPrivate = NULL;
}
static Bool
@@ -596,8 +608,8 @@ PreInit(ScrnInfoPtr pScrn, int flags)
#if XSERVER_PLATFORM_BUS
if (pEnt->location.type == BUS_PLATFORM) {
- char *path = xf86_get_platform_device_attrib(pEnt->location.id.plat, ODEV_ATTRIB_PATH);
- ms->fd = open_hw(path);
+ char *path = xf86_get_platform_device_attrib(pEnt->location.id.plat, ODEV_ATTRIB_PATH);
+ ms->fd = open_hw(path);
}
else
#endif
commit 1e571934629280053caeb155e418acbdca609e36
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Wed Feb 20 17:27:16 2013 -0800
modesetting: match PCI class 3, any subclass
If a device is not primary, the PCI device match fails because the
xf86-video-modesetting driver looks specifically for a PCI class match of
0x30000 with a mask of 0xffffff. This fails to match, for example, a
non-primary Intel VGA device, because it is reported as having a class of
0x38000.
Fix that by ignoring the low 16 bits of the class in the pci_id_match table.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed on IRC by Adam Jackson <ajax@redhat.com>
diff --git a/src/driver.c b/src/driver.c
index 05b6176..87ba272 100644
--- a/src/driver.c
+++ b/src/driver.c
@@ -86,7 +86,7 @@ static Bool ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op,
static const struct pci_id_match ms_device_match[] = {
{
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
- 0x00030000, 0x00ffffff, 0
+ 0x00030000, 0x00ff0000, 0
},
{ 0, 0, 0 },
commit 8dd5b22ea4469515b4218fad0deaf76cc98e3b9c
Author: Colin Walters <walters@verbum.org>
Date: Wed Jan 4 22:37:06 2012 +0000
autogen.sh: Implement GNOME Build API
http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Adam Jackson <ajax@redhat.com>
diff --git a/autogen.sh b/autogen.sh
index f83ed27..7415c05 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -10,4 +10,6 @@ test -d m4 || mkdir m4
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
-$srcdir/configure --enable-maintainer-mode "$@"
+if test -z "$NOCONFIGURE"; then
+ $srcdir/configure "$@"
+fi
commit 06618a9b3d9585508b0debd18d5b981636f98c54
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Mon Dec 3 13:25:19 2012 +0000
Add missing GTF modes
A fixed-mode output device like a panel will often only inform of its
preferred mode through its EDID. However, the driver will adjust user
specified modes for display through use of a panel-fitter allowing
greater flexibility in upscaling. This is often used by games to set a
low resolution for performance and use the panel fitter to fill the
screen.
v2: Use the presence of the 'scaling mode' connector property as an
indication that a panel fitter is attached to that pipe.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55564
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 63cecc3..e8ebef1 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -626,6 +626,78 @@ drmmode_output_mode_valid(xf86OutputPtr output, DisplayModePtr pModes)
return MODE_OK;
}
+static Bool
+has_panel_fitter(xf86OutputPtr output)
+{
+ drmmode_output_private_ptr drmmode_output = output->driver_private;
+ drmModeConnectorPtr koutput = drmmode_output->mode_output;
+ drmmode_ptr drmmode = drmmode_output->drmmode;
+ int i;
+
+ /* Presume that if the output supports scaling, then we have a
+ * panel fitter capable of adjust any mode to suit.
+ */
+ for (i = 0; i < koutput->count_props; i++) {
+ drmModePropertyPtr props;
+ Bool found = FALSE;
+
+ props = drmModeGetProperty(drmmode->fd, koutput->props[i]);
+ if (props) {
+ found = strcmp(props->name, "scaling mode") == 0;
+ drmModeFreeProperty(props);
+ }
+
+ if (found)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+static DisplayModePtr
+drmmode_output_add_gtf_modes(xf86OutputPtr output,
+ DisplayModePtr Modes)
+{
+ xf86MonPtr mon = output->MonInfo;
+ DisplayModePtr i, m, preferred = NULL;
+ int max_x = 0, max_y = 0;
+ float max_vrefresh = 0.0;
+
+ if (mon && GTF_SUPPORTED(mon->features.msc))
+ return Modes;
+
+ if (!has_panel_fitter(output))
+ return Modes;
+
+ for (m = Modes; m; m = m->next) {
+ if (m->type & M_T_PREFERRED)
+ preferred = m;
+ max_x = max(max_x, m->HDisplay);
+ max_y = max(max_y, m->VDisplay);
+ max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(m));
+ }
+
+ max_vrefresh = max(max_vrefresh, 60.0);
+ max_vrefresh *= (1 + SYNC_TOLERANCE);
+
+ m = xf86GetDefaultModes();
+ xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0);
+
+ for (i = m; i; i = i->next) {
+ if (xf86ModeVRefresh(i) > max_vrefresh)
+ i->status = MODE_VSYNC;
+ if (preferred &&
+ i->HDisplay >= preferred->HDisplay &&
+ i->VDisplay >= preferred->VDisplay &&
+ xf86ModeVRefresh(i) >= xf86ModeVRefresh(preferred))
+ i->status = MODE_VSYNC;
+ }
+
+ xf86PruneInvalidModes(output->scrn, &m, FALSE);
+
+ return xf86ModesAdd(Modes, m);
+}
+
static DisplayModePtr
drmmode_output_get_modes(xf86OutputPtr output)
{
@@ -666,7 +738,8 @@ drmmode_output_get_modes(xf86OutputPtr output)
Modes = xf86ModesAdd(Modes, Mode);
}
- return Modes;
+
+ return drmmode_output_add_gtf_modes(output, Modes);
}
static void
commit acb90bc34ad99a7c4de8c69a26ff09a65cd0281d
Author: Dave Airlie <airlied@redhat.com>
Date: Thu Feb 7 12:24:20 2013 +1000
modesetting: provide dummy hooks for shadow
Since in some wierd cases the server can call these without checking they
exist.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 42cd5ac..63cecc3 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -547,6 +547,17 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix)
}
#endif
+static void *drmmode_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
+{
+ return NULL;
+}
+
+static PixmapPtr drmmode_shadow_create(xf86CrtcPtr crtc, void *data, int width,
+ int height)
+{
+ return NULL;
+}
+
static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
.dpms = drmmode_crtc_dpms,
.set_mode_major = drmmode_set_mode_major,
@@ -561,6 +572,8 @@ static const xf86CrtcFuncsRec drmmode_crtc_funcs = {
#ifdef MODESETTING_OUTPUT_SLAVE_SUPPORT
.set_scanout_pixmap = drmmode_set_scanout_pixmap,
#endif
+ .shadow_allocate = drmmode_shadow_allocate,
+ .shadow_create = drmmode_shadow_create,
};
static void
Reply to: