xf86-video-intel: 2 commits - src/drmmode_display.c src/i830_dri.c
Kristian Høgsberg
krh at kemper.freedesktop.org
Mon Feb 23 12:18:25 PST 2009
src/drmmode_display.c | 3 ++-
src/i830_dri.c | 21 ++++++++-------------
2 files changed, 10 insertions(+), 14 deletions(-)
New commits:
commit 73bc7f113969834d00cd92be8374dbadc62f96a9
Author: Kristian Høgsberg <krh at redhat.com>
Date: Mon Feb 23 15:16:51 2009 -0500
KMS: Fix bug that prevented EDID data from getting propagated.
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 0ae7d34..f0e4f1e 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -460,7 +460,8 @@ drmmode_output_get_modes(xf86OutputPtr output)
if (!props || !(props->flags & DRM_MODE_PROP_BLOB))
continue;
- if (!strcmp(props->name, "EDID") && drmmode_output->edid_blob) {
+ if (!strcmp(props->name, "EDID") &&
+ drmmode_output->edid_blob == NULL) {
drmModeFreePropertyBlob(drmmode_output->edid_blob);
drmmode_output->edid_blob =
drmModeGetPropertyBlob(drmmode->fd,
commit ef952760551ad15cb9f63025d1e087645949a227
Author: Kristian Høgsberg <krh at redhat.com>
Date: Sun Feb 15 22:10:42 2009 -0500
Use stat() and the dev_t to find the drm device filename.
Simpler and more robust. Works when we haven't set the device PCI ID,
ie when not going through the legacy DRI module.
diff --git a/src/i830_dri.c b/src/i830_dri.c
index f03be43..105bb10 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -66,6 +66,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <string.h>
#include <assert.h>
#include <sys/types.h>
+#include <sys/stat.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <unistd.h>
@@ -1677,8 +1678,10 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
I830Ptr pI830 = I830PTR(pScrn);
DRI2InfoRec info;
- char *p, *busId, buf[64];
+ char *p, buf[64];
int fd, i, cmp;
+ struct stat sbuf;
+ dev_t d;
if (pI830->accel != ACCEL_UXA) {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DRI2 requires UXA\n");
@@ -1712,21 +1715,13 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
* things worse with even more ad hoc directory walking code to
* discover the device file name. */
+ fstat(info.fd, &sbuf);
+ d = sbuf.st_rdev;
+
p = pI830->deviceName;
for (i = 0; i < DRM_MAX_MINOR; i++) {
sprintf(p, DRM_DEV_NAME, DRM_DIR_NAME, i);
- fd = open(p, O_RDWR);
- if (fd < 0)
- continue;
-
- busId = drmGetBusid(fd);
- close(fd);
- if (busId == NULL)
- continue;
-
- cmp = strcmp(busId, buf);
- drmFree(busId);
- if (cmp == 0)
+ if (stat(p, &sbuf) == 0 && sbuf.st_rdev == d)
break;
}
if (i == DRM_MAX_MINOR) {
More information about the xorg-commit
mailing list