configure.ac | 4 - debian/changelog | 6 ++ src/driver.c | 110 ++++++++++++++++++++++++++++++++++++++++---------- src/driver.h | 2 src/drmmode_display.c | 40 ++++++++++++++---- 5 files changed, 131 insertions(+), 31 deletions(-)
New commits: commit 0a352bd93c4002af08b743e91bd140a6e3edacf6 Author: Maarten Lankhorst <maarten.lankho...@canonical.com> Date: Thu Jun 26 10:43:17 2014 +0200 release to unstable diff --git a/debian/changelog b/debian/changelog index 906d569..e7c6b04 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -xserver-xorg-video-modesetting (0.9.0-1) UNRELEASED; urgency=low +xserver-xorg-video-modesetting (0.9.0-1) unstable; urgency=medium * New upstream release. commit b424cf723797a0469af8a6d4ee6799ca172c4c28 Author: Maarten Lankhorst <maarten.lankho...@canonical.com> Date: Thu Jun 26 10:42:30 2014 +0200 bump changelog diff --git a/debian/changelog b/debian/changelog index af9c12c..906d569 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +xserver-xorg-video-modesetting (0.9.0-1) UNRELEASED; urgency=low + + * New upstream release. + + -- Maarten Lankhorst <maarten.lankho...@ubuntu.com> Thu, 26 Jun 2014 10:41:50 +0200 + xserver-xorg-video-modesetting (0.8.1-2) unstable; urgency=medium * Add modprobe config file to enable cirrus and mgag200 kms drivers. commit 1e4cb922617990a3005ac23b0c90f89147c3564b Author: Maarten Lankhorst <maarten.lankho...@canonical.com> Date: Thu Jun 26 10:37:19 2014 +0200 bump to 0.9.0 diff --git a/configure.ac b/configure.ac index 0ec8e18..1c1a36d 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) AC_INIT([xf86-video-modesetting], - [0.8.1], + [0.9.0], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xf86-video-modesetting]) AC_CONFIG_SRCDIR([Makefile.am]) commit d1c6e27759ea1d2c30cabc62ff2bc315bbbec5fc Author: Adam Jackson <a...@redhat.com> Date: Wed May 21 10:16:39 2014 -0400 Use own thunk function instead of shadowUpdatePackedWeak I plan to remove the Weak functions from a future server. Signed-off-by: Adam Jackson <a...@redhat.com> diff --git a/src/driver.c b/src/driver.c index 21274a9..d99b027 100644 --- a/src/driver.c +++ b/src/driver.c @@ -810,6 +810,12 @@ msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode, return ((uint8_t *)ms->drmmode.front_bo->ptr + row * stride + offset); } +static void +msUpdatePacked(ScreenPtr pScreen, shadowBufPtr pBuf) +{ + shadowUpdatePacked(pScreen, pBuf); +} + static Bool CreateScreenResources(ScreenPtr pScreen) { @@ -842,7 +848,7 @@ CreateScreenResources(ScreenPtr pScreen) FatalError("Couldn't adjust screen pixmap\n"); if (ms->drmmode.shadow_enable) { - if (!shadowAdd(pScreen, rootPixmap, shadowUpdatePackedWeak(), + if (!shadowAdd(pScreen, rootPixmap, msUpdatePacked, msShadowWindow, 0, 0)) return FALSE; } commit 07c5d9cb782fde2a073efdc437489d6c4b432d46 Author: Dave Airlie <airl...@redhat.com> Date: Fri May 2 13:16:05 2014 +1000 modesetting: fix build regression against older servers. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/driver.c b/src/driver.c index b5fcdaf..21274a9 100644 --- a/src/driver.c +++ b/src/driver.c @@ -217,7 +217,7 @@ static Bool probe_hw(const char *dev, struct xf86_platform_device *platform_dev) { int fd; -#if XSERVER_PLATFORM_BUS +#if XF86_PDEV_SERVER_FD if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) { fd = xf86_get_platform_device_int_attrib(platform_dev, ODEV_ATTRIB_FD, -1); if (fd == -1) commit 32fb5f2d821e5e13038eab7db35c5048ad807ccc Author: Dave Airlie <airl...@redhat.com> Date: Fri May 2 13:14:30 2014 +1000 modesetting: fix use after free. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 28a4abb..c533324 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -778,11 +778,11 @@ drmmode_output_destroy(xf86OutputPtr output) drmModeFreeProperty(drmmode_output->props[i].mode_prop); free(drmmode_output->props[i].atoms); } + free(drmmode_output->props); for (i = 0; i < drmmode_output->mode_output->count_encoders; i++) { drmModeFreeEncoder(drmmode_output->mode_encoders[i]); - free(drmmode_output->mode_encoders); } - free(drmmode_output->props); + free(drmmode_output->mode_encoders); drmModeFreeConnector(drmmode_output->mode_output); free(drmmode_output); output->driver_private = NULL; commit 509dbe8cab339e44b02fed3728bbef7de5c60d05 Author: Hans de Goede <hdego...@redhat.com> Date: Tue Mar 18 15:48:22 2014 +0100 Add support for server managed fds Signed-off-by: Hans de Goede <hdego...@redhat.com> diff --git a/src/driver.c b/src/driver.c index 0f9190a..b5fcdaf 100644 --- a/src/driver.c +++ b/src/driver.c @@ -213,9 +213,20 @@ static int check_outputs(int fd) return ret; } -static Bool probe_hw(const char *dev) +static Bool probe_hw(const char *dev, struct xf86_platform_device *platform_dev) { - int fd = open_hw(dev); + int fd; + +#if XSERVER_PLATFORM_BUS + if (platform_dev && (platform_dev->flags & XF86_PDEV_SERVER_FD)) { + fd = xf86_get_platform_device_int_attrib(platform_dev, ODEV_ATTRIB_FD, -1); + if (fd == -1) + return FALSE; + return check_outputs(fd); + } +#endif + + fd = open_hw(dev); if (fd != -1) { int ret = check_outputs(fd); close(fd); @@ -283,6 +294,10 @@ ms_driver_func(ScrnInfoPtr scrn, xorgDriverFuncOp op, void *data) flag = (CARD32 *)data; (*flag) = 0; return TRUE; +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0) + case SUPPORTS_SERVER_FDS: + return TRUE; +#endif default: return FALSE; } @@ -341,7 +356,7 @@ ms_platform_probe(DriverPtr driver, if (flags & PLATFORM_PROBE_GPU_SCREEN) scr_flags = XF86_ALLOCATE_GPU_SCREEN; - if (probe_hw(path)) { + if (probe_hw(path, dev)) { scrn = xf86AllocateScreen(driver, scr_flags); xf86AddEntityToScreen(scrn, entity_num); @@ -387,7 +402,7 @@ Probe(DriverPtr drv, int flags) for (i = 0; i < numDevSections; i++) { dev = xf86FindOptionValue(devSections[i]->options,"kmsdev"); - if (probe_hw(dev)) { + if (probe_hw(dev, NULL)) { int entity; entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE); scrn = xf86ConfigFbEntity(scrn, 0, entity, @@ -558,6 +573,10 @@ FreeRec(ScrnInfoPtr pScrn) if (ms->pEnt->location.type == BUS_PCI) ret = drmClose(ms->fd); else +#ifdef XF86_PDEV_SERVER_FD + if (!(ms->pEnt->location.type == BUS_PLATFORM && + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD))) +#endif ret = close(ms->fd); (void) ret; } @@ -630,8 +649,15 @@ 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); +#ifdef XF86_PDEV_SERVER_FD + if (pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD) + ms->fd = xf86_get_platform_device_int_attrib(pEnt->location.id.plat, ODEV_ATTRIB_FD, -1); + else +#endif + { + char *path = xf86_get_platform_device_attrib(pEnt->location.id.plat, ODEV_ATTRIB_PATH); + ms->fd = open_hw(path); + } } else #endif @@ -865,21 +891,37 @@ msSetSharedPixmapBacking(PixmapPtr ppix, void *fd_handle) #endif static Bool +SetMaster(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + int ret; + +#ifdef XF86_PDEV_SERVER_FD + if (ms->pEnt->location.type == BUS_PLATFORM && + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) + return TRUE; +#endif + + ret = drmSetMaster(ms->fd); + if (ret) + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "drmSetMaster failed: %s\n", + strerror(errno)); + + return ret == 0; +} + +static Bool ScreenInit(SCREEN_INIT_ARGS_DECL) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); modesettingPtr ms = modesettingPTR(pScrn); VisualPtr visual; - int ret; pScrn->pScreen = pScreen; - ret = drmSetMaster(ms->fd); - if (ret) { - ErrorF("Unable to set master\n"); + if (!SetMaster(pScrn)) return FALSE; - } - + /* HW dependent - FIXME */ pScrn->displayWidth = pScrn->virtualX; if (!drmmode_create_initial_bos(pScrn, &ms->drmmode)) @@ -1010,6 +1052,12 @@ LeaveVT(VT_FUNC_ARGS_DECL) pScrn->vtSema = FALSE; +#ifdef XF86_PDEV_SERVER_FD + if (ms->pEnt->location.type == BUS_PLATFORM && + (ms->pEnt->location.id.plat->flags & XF86_PDEV_SERVER_FD)) + return; +#endif + drmDropMaster(ms->fd); } @@ -1024,10 +1072,7 @@ EnterVT(VT_FUNC_ARGS_DECL) pScrn->vtSema = TRUE; - if (drmSetMaster(ms->fd)) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "drmSetMaster failed: %s\n", - strerror(errno)); - } + SetMaster(pScrn); if (!drmmode_set_desired_modes(pScrn, &ms->drmmode)) return FALSE; commit c9d377a19201973012bb6bbb07e3b8c3e9c3b856 Author: Dave Airlie <airl...@redhat.com> Date: Fri Feb 28 12:04:30 2014 +1000 modesetting: fix cursor rendering with hotspots. older kernels report EINVAL not ENOSYS, doh. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 5b796e0..28a4abb 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -500,7 +500,7 @@ drmmode_show_cursor (xf86CrtcPtr crtc) CursorPtr cursor = xf86_config->cursor; int ret; ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height, cursor->bits->xhot, cursor->bits->yhot); - if (ret == -ENOSYS) + if (ret == -EINVAL) use_set_cursor2 = FALSE; else return; commit b8840f5442f9fbd8ce47ab2dd555b75cf4bb114a Author: Adam Jackson <a...@redhat.com> Date: Tue Feb 25 09:06:55 2014 -0500 modesetting: Don't (brokenly) double-track software cursor Signed-off-by: Adam Jackson <a...@redhat.com> diff --git a/src/driver.c b/src/driver.c index 4a74ece..0f9190a 100644 --- a/src/driver.c +++ b/src/driver.c @@ -801,7 +801,7 @@ CreateScreenResources(ScreenPtr pScreen) drmmode_uevent_init(pScrn, &ms->drmmode); - if (!ms->SWCursor) + if (!ms->drmmode.sw_cursor) drmmode_map_cursor_bos(pScrn, &ms->drmmode); pixels = drmmode_map_front_bo(&ms->drmmode); if (!pixels) diff --git a/src/driver.h b/src/driver.h index e84d748..450b29c 100644 --- a/src/driver.h +++ b/src/driver.h @@ -59,7 +59,6 @@ typedef struct _modesettingRec #endif Bool noAccel; - Bool SWCursor; CloseScreenProcPtr CloseScreen; /* Broken-out options. */ commit c36a5e298c36deb5f6fd0eef3029235aa58de295 Author: Dave Airlie <airl...@redhat.com> Date: Mon Jan 20 11:06:42 2014 +1000 modesetting: try and use hotspot cursor support Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/configure.ac b/configure.ac index 0b04923..0ec8e18 100644 --- a/configure.ac +++ b/configure.ac @@ -74,7 +74,7 @@ AM_CONDITIONAL(HAVE_XEXTPROTO_71, [ test "$HAVE_XEXTPROTO_71" = "yes" ]) # Checks for header files. AC_HEADER_STDC -PKG_CHECK_MODULES(DRM, [libdrm >= 2.2]) +PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.46]) PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10]) AM_CONDITIONAL(DRM, test "x$DRM" = xyes) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index ccfd75f..5b796e0 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -43,6 +43,8 @@ #include "xf86Crtc.h" #include "drmmode_display.h" +#include <cursorstr.h> + /* DPMS */ #ifdef HAVE_XEXTPROTO_71 #include <X11/extensions/dpmsconst.h> @@ -491,6 +493,18 @@ drmmode_show_cursor (xf86CrtcPtr crtc) drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; + static Bool use_set_cursor2 = TRUE; + + if (use_set_cursor2) { + xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + CursorPtr cursor = xf86_config->cursor; + int ret; + ret = drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height, cursor->bits->xhot, cursor->bits->yhot); + if (ret == -ENOSYS) + use_set_cursor2 = FALSE; + else + return; + } drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height); commit bf359b118a0870f18a229d33979270ac2f0f5dcd Author: Dave Airlie <airl...@redhat.com> Date: Fri Feb 21 12:48:42 2014 +1000 modesetting: move closing fd to after we check outputs On something like cirrus, start X, then attempt to start a second X while the first is running, if fbdev is installed it'll fail hard. Signed-off-by: Dave Airlie <airl...@redhat.com> diff --git a/src/driver.c b/src/driver.c index b28622a..4a74ece 100644 --- a/src/driver.c +++ b/src/driver.c @@ -258,11 +258,11 @@ static Bool probe_hw_pci(const char *dev, struct pci_device *pdev) id = drmGetBusid(fd); devid = ms_DRICreatePCIBusID(pdev); - close(fd); if (id && devid && !strcmp(id, devid)) ret = check_outputs(fd); + close(fd); free(id); free(devid); return ret; commit 677935b2d20f54f21c645b5eb386b6c9485fee5f Author: Alex Deucher <alexander.deuc...@amd.com> Date: Wed Feb 12 13:06:51 2014 -0500 modesetting: query cursor size from the kernel Use new drm caps. This allows hw cursors to work correctly on gpus with non-64x64 cursors. Signed-off-by: Alex Deucher <alexander.deuc...@amd.com> diff --git a/src/driver.c b/src/driver.c index b84624e..b28622a 100644 --- a/src/driver.c +++ b/src/driver.c @@ -566,6 +566,14 @@ FreeRec(ScrnInfoPtr pScrn) } +#ifndef DRM_CAP_CURSOR_WIDTH +#define DRM_CAP_CURSOR_WIDTH 0x8 +#endif + +#ifndef DRM_CAP_CURSOR_HEIGHT +#define DRM_CAP_CURSOR_HEIGHT 0x9 +#endif + static Bool PreInit(ScrnInfoPtr pScrn, int flags) { @@ -706,6 +714,17 @@ PreInit(ScrnInfoPtr pScrn, int flags) prefer_shadow = !!value; } + ms->cursor_width = 64; + ms->cursor_height = 64; + ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_WIDTH, &value); + if (!ret) { + ms->cursor_width = value; + } + ret = drmGetCap(ms->fd, DRM_CAP_CURSOR_HEIGHT, &value); + if (!ret) { + ms->cursor_height = value; + } + ms->drmmode.shadow_enable = xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, prefer_shadow); xf86DrvMsg(pScrn->scrnIndex, X_INFO, "ShadowFB: preferred %s, enabled %s\n", prefer_shadow ? "YES" : "NO", ms->drmmode.shadow_enable ? "YES" : "NO"); @@ -933,7 +952,7 @@ ScreenInit(SCREEN_INIT_ARGS_DECL) /* Need to extend HWcursor support to handle mask interleave */ if (!ms->drmmode.sw_cursor) - xf86_cursors_init(pScreen, 64, 64, + xf86_cursors_init(pScreen, ms->cursor_width, ms->cursor_height, HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | HARDWARE_CURSOR_ARGB); diff --git a/src/driver.h b/src/driver.h index 79561c8..e84d748 100644 --- a/src/driver.h +++ b/src/driver.h @@ -76,6 +76,7 @@ typedef struct _modesettingRec DamagePtr damage; Bool dirty_enabled; + uint32_t cursor_width, cursor_height; } modesettingRec, *modesettingPtr; #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate)) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 25641ce..ccfd75f 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -52,6 +52,8 @@ #endif #include "compat-api.h" +#include "driver.h" + static struct dumb_bo *dumb_bo_create(int fd, const unsigned width, const unsigned height, const unsigned bpp) @@ -445,6 +447,7 @@ drmmode_set_cursor_position (xf86CrtcPtr crtc, int x, int y) static void drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) { + modesettingPtr ms = modesettingPTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; int i; uint32_t *ptr; @@ -453,10 +456,11 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) /* cursor should be mapped already */ ptr = (uint32_t *)(drmmode_crtc->cursor_bo->ptr); - for (i = 0; i < 64 * 64; i++) + for (i = 0; i < ms->cursor_width * ms->cursor_height; i++) ptr[i] = image[i];// cpu_to_le32(image[i]); - ret = drmModeSetCursor(drmmode_crtc->drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, 64, 64); + ret = drmModeSetCursor(drmmode_crtc->drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, + ms->cursor_width, ms->cursor_height); if (ret) { xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn); xf86CursorInfoPtr cursor_info = xf86_config->cursor_info; @@ -471,21 +475,25 @@ drmmode_load_cursor_argb (xf86CrtcPtr crtc, CARD32 *image) static void drmmode_hide_cursor (xf86CrtcPtr crtc) { + modesettingPtr ms = modesettingPTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; - drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, 64, 64); + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, 0, + ms->cursor_width, ms->cursor_height); } static void drmmode_show_cursor (xf86CrtcPtr crtc) { + modesettingPtr ms = modesettingPTR(crtc->scrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; uint32_t handle = drmmode_crtc->cursor_bo->handle; - drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, 64, 64); + drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, + ms->cursor_width, ms->cursor_height); } static void @@ -1485,6 +1493,7 @@ void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode) /* create front and cursor BOs */ Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) { + modesettingPtr ms = modesettingPTR(pScrn); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); int width; int height; @@ -1500,7 +1509,8 @@ Bool drmmode_create_initial_bos(ScrnInfoPtr pScrn, drmmode_ptr drmmode) return FALSE; pScrn->displayWidth = drmmode->front_bo->pitch / cpp; - width = height = 64; + width = ms->cursor_width; + height = ms->cursor_height; bpp = 32; for (i = 0; i < xf86_config->num_crtc; i++) { xf86CrtcPtr crtc = xf86_config->crtc[i]; -- To UNSUBSCRIBE, email to debian-x-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org Archive: https://lists.debian.org/e1x05od-00015b...@moszumanska.debian.org