From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fllnx210.ext.ti.com (fllnx210.ext.ti.com [198.47.19.17]) by arago-project.org (Postfix) with ESMTPS id AAAF05298D for ; Tue, 6 Dec 2016 20:48:29 +0000 (UTC) Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id uB6KmTH9003777 for ; Tue, 6 Dec 2016 14:48:29 -0600 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id uB6KmTDh012494 for ; Tue, 6 Dec 2016 14:48:29 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Tue, 6 Dec 2016 14:48:29 -0600 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id uB6KmTkJ007281; Tue, 6 Dec 2016 14:48:29 -0600 Date: Tue, 6 Dec 2016 15:48:29 -0500 From: Denys Dmytriyenko To: Eric Ruei Message-ID: <20161206204828.GL28380@edge> References: <1481055129-26965-1-git-send-email-e-ruei1@ti.com> MIME-Version: 1.0 In-Reply-To: <1481055129-26965-1-git-send-email-e-ruei1@ti.com> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: meta-arago@arago-project.org Subject: Re: [PATCH] weston: fix hotplug weston termination problem at compositor-drm X-BeenThere: meta-arago@arago-project.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Arago metadata layer for TI SDKs - OE-Core/Yocto compatible List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Dec 2016 20:48:29 -0000 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline Eric, et al, We keep accumulating patches to Weston and other Open Source components - we need to start tracking their corresponding upstream status per the guidelines: http://openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations So far I was not enforcing that requirement, mostly because the patches were rather TI-specific. But more and more patches are becoming rather generic and should be submitted upstream to the corresponding project, like Weston. In that case Upstream-Status: field is need to track the acceptance of the patch upstream. Please start including the correct Upstream-Status: field in the patches. Thanks. -- Denys On Tue, Dec 06, 2016 at 03:12:09PM -0500, Eric Ruei wrote: > The weston_compositor_exit() is always invoked at function update_outputs() > if all connector ids are greater than 31 because the 32-bit b->connector_allocator > will be zero. Need to increase the size of both crtc_allocator and > connector_allocator from 32-bit to 64-bit until a better solution is implemented. > > Signed-off-by: Eric Ruei > --- > ...drm-fix-hotplug-weston-termination-proble.patch | 110 +++++++++++++++++++++ > .../recipes-graphics/wayland/weston_1.9.0.bbappend | 3 +- > 2 files changed, 112 insertions(+), 1 deletion(-) > create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch > > diff --git a/meta-arago-distro/recipes-graphics/wayland/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch b/meta-arago-distro/recipes-graphics/wayland/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch > new file mode 100644 > index 0000000..35f289c > --- /dev/null > +++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-compositor-drm-fix-hotplug-weston-termination-proble.patch > @@ -0,0 +1,110 @@ > +From 1d956770aa7d1ba4ca1bbb7eff469f27d7267b02 Mon Sep 17 00:00:00 2001 > +From: Eric Ruei > +Date: Wed, 23 Nov 2016 16:54:51 -0500 > +Subject: [PATCH] compositor-drm: fix hotplug weston termination problem > + > +The weston_compositor_exit() is always invoked at function update_outputs() > +if all connector ids are greater than 31 because the 32-bit b->connector_allocator > +will be zero. Need to increase the size of both crtc_allocator and > +connector_allocator from 32-bit to 64-bit until a better solution is implemented. > + > +Signed-off-by: Eric Ruei > +--- > + src/compositor-drm.c | 30 +++++++++++++++--------------- > + 1 file changed, 15 insertions(+), 15 deletions(-) > + > +diff --git a/src/compositor-drm.c b/src/compositor-drm.c > +index 6485b39..e4d889f 100644 > +--- a/src/compositor-drm.c > ++++ b/src/compositor-drm.c > +@@ -103,8 +103,8 @@ struct drm_backend { > + struct gbm_device *gbm; > + uint32_t *crtcs; > + int num_crtcs; > +- uint32_t crtc_allocator; > +- uint32_t connector_allocator; > ++ uint64_t crtc_allocator; > ++ uint64_t connector_allocator; > + struct wl_listener session_listener; > + uint32_t format; > + > +@@ -1360,8 +1360,8 @@ drm_output_destroy(struct weston_output *output_base) > + &output->connector_id, 1, &origcrtc->mode); > + drmModeFreeCrtc(origcrtc); > + > +- b->crtc_allocator &= ~(1 << output->crtc_id); > +- b->connector_allocator &= ~(1 << output->connector_id); > ++ b->crtc_allocator &= ~(1ULL << output->crtc_id); > ++ b->connector_allocator &= ~(1ULL << output->connector_id); > + > + if (b->use_pixman) { > + drm_output_fini_pixman(output); > +@@ -1842,8 +1842,8 @@ find_crtc_for_connector(struct drm_backend *b, > + drmModeFreeEncoder(encoder); > + > + for (i = 0; i < resources->count_crtcs; i++) { > +- if (possible_crtcs & (1 << i) && > +- !(b->crtc_allocator & (1 << resources->crtcs[i]))) > ++ if (possible_crtcs & (1ULL << i) && > ++ !(b->crtc_allocator & (1ULL << resources->crtcs[i]))) > + return i; > + } > + } > +@@ -2404,9 +2404,9 @@ create_output_for_connector(struct drm_backend *b, > + > + output->crtc_id = resources->crtcs[i]; > + output->pipe = i; > +- b->crtc_allocator |= (1 << output->crtc_id); > ++ b->crtc_allocator |= (1ULL << output->crtc_id); > + output->connector_id = connector->connector_id; > +- b->connector_allocator |= (1 << output->connector_id); > ++ b->connector_allocator |= (1ULL << output->connector_id); > + > + output->original_crtc = drmModeGetCrtc(b->drm.fd, output->crtc_id); > + output->dpms_prop = drm_get_prop(b->drm.fd, connector, "DPMS"); > +@@ -2511,8 +2511,8 @@ err_free: > + } > + > + drmModeFreeCrtc(output->original_crtc); > +- b->crtc_allocator &= ~(1 << output->crtc_id); > +- b->connector_allocator &= ~(1 << output->connector_id); > ++ b->crtc_allocator &= ~(1ULL << output->crtc_id); > ++ b->connector_allocator &= ~(1ULL << output->connector_id); > + free(output); > + > + return -1; > +@@ -2658,7 +2658,7 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) > + drmModeRes *resources; > + struct drm_output *output, *next; > + int x = 0, y = 0; > +- uint32_t connected = 0, disconnects = 0; > ++ uint64_t connected = 0, disconnects = 0; > + int i; > + > + resources = drmModeGetResources(b->drm.fd); > +@@ -2680,9 +2680,9 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) > + continue; > + } > + > +- connected |= (1 << connector_id); > ++ connected |= (1ULL << connector_id); > + > +- if (!(b->connector_allocator & (1 << connector_id))) { > ++ if (!(b->connector_allocator & (1ULL << connector_id))) { > + struct weston_output *last = > + container_of(b->compositor->output_list.prev, > + struct weston_output, link); > +@@ -2707,8 +2707,8 @@ update_outputs(struct drm_backend *b, struct udev_device *drm_device) > + if (disconnects) { > + wl_list_for_each_safe(output, next, &b->compositor->output_list, > + base.link) { > +- if (disconnects & (1 << output->connector_id)) { > +- disconnects &= ~(1 << output->connector_id); > ++ if (disconnects & (1ULL << output->connector_id)) { > ++ disconnects &= ~(1ULL << output->connector_id); > + weston_log("connector %d disconnected\n", > + output->connector_id); > + drm_output_destroy(&output->base); > +-- > +1.9.1 > + > diff --git a/meta-arago-distro/recipes-graphics/wayland/weston_1.9.0.bbappend b/meta-arago-distro/recipes-graphics/wayland/weston_1.9.0.bbappend > index cde8374..9cc1023 100644 > --- a/meta-arago-distro/recipes-graphics/wayland/weston_1.9.0.bbappend > +++ b/meta-arago-distro/recipes-graphics/wayland/weston_1.9.0.bbappend > @@ -2,7 +2,7 @@ > PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor WESTON_NATIVE_BACKEND="fbdev-backend.so",--disable-fbdev-compositor,udev mtdev" > PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev libgbm mtdev" > > -PR_append = ".arago15" > +PR_append = ".arago16" > > FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" > > @@ -16,4 +16,5 @@ SRC_URI += " \ > file://0001-udev-seat-restrict-udev-enumeration-to-card0.patch \ > file://0001-Add-soc-performance-monitor-utilites.patch \ > file://0001-compositor-drm-support-RGB565-with-pixman-renderer.patch \ > + file://0001-compositor-drm-fix-hotplug-weston-termination-proble.patch \ > " > -- > 1.9.1 > > _______________________________________________ > meta-arago mailing list > meta-arago@arago-project.org > http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago