From patchwork Sat Jun 11 13:50:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9171035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF17160573 for ; Sat, 11 Jun 2016 13:50:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 920522766D for ; Sat, 11 Jun 2016 13:50:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85E4E27C0C; Sat, 11 Jun 2016 13:50:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CF2BF2766D for ; Sat, 11 Jun 2016 13:50:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 43B286E1EC; Sat, 11 Jun 2016 13:50:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0084.outbound.protection.outlook.com [65.55.169.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 64B696E1EC for ; Sat, 11 Jun 2016 13:50:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=IkNha21Gcghn5FJoN+u420Yqmx9u1eXQXxBXyRhW8G0=; b=R6M2wNkBD2ZJCs8EKZnUvETq6SBQFTrSP90EF8RBdqAD50zWwqRWtWYjvoHD4DZa9LBNijkPcOJAMqeLKvpQTh/3exNHcrVXYcNBBguG1cwUFWWjQHkFf8IDqo7RdrXG3evj+4maGObhytM19RAIPlG3xIsIch+x3mspI95EbbY= Received: from BLUPR12MB0401.namprd12.prod.outlook.com (10.162.91.26) by BLUPR12MB0402.namprd12.prod.outlook.com (10.162.91.27) with Microsoft SMTP Server (TLS) id 15.1.511.8; Sat, 11 Jun 2016 13:50:17 +0000 Received: from BLUPR12MB0401.namprd12.prod.outlook.com ([10.162.91.26]) by BLUPR12MB0401.namprd12.prod.outlook.com ([10.162.91.26]) with mapi id 15.01.0517.009; Sat, 11 Jun 2016 13:50:17 +0000 From: "Grodzovsky, Andrey" To: "dri-devel@lists.freedesktop.org" Subject: drm/dp/mst: change MST detection scheme (v2) - reminder Thread-Topic: drm/dp/mst: change MST detection scheme (v2) - reminder Thread-Index: AdHD6C2MYR2dE+pATFGtG73AyZOOEg== Date: Sat, 11 Jun 2016 13:50:17 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Andrey.Grodzovsky@amd.com; x-originating-ip: [165.204.55.251] x-ms-office365-filtering-correlation-id: 016faaf8-d531-4a9f-e73e-08d391ff52a9 x-microsoft-exchange-diagnostics: 1; BLUPR12MB0402; 5:scprlb0JAOXd9z3Xd6TZzB0PGUKdcMhipGUlOvZ6FqfbZypO7KCle2Mg7QwUwG9+LxHuEUS8M70g/sIRqaU6NjVAOjBtLsqIF6MRCXGdQ3BWXCg3XjwnRllanc+bCGA2Fv+EANfHEKNzcfbrrn7YNA==; 24:Ejzq4FBixHwlak8Z3at7XTAuHDnVgvVwIwHFWrkdieg6MFZlR7F/mlo5Lo1M+pFd+g0ugQlg3DKwP6nJktuf8ogrjWI/3GaLV/Lm0CIu+JA=; 7:m0Bnwr67HzJ9AR4T713Yr75JIv/F9uS2n8fZUABn868IT6I2C6BojX6WbZVxMcYdNipHYoCvrOQFsx4Sc2IhATAbNVfuppeB4kX9lXOH2ytl0NaFmbAUAhBiTkoKxQV841VDGwjt1zSA3K9QWATW/IHMuXW8o6/4EZzeBRRGhiBVrTJ2/6DzKQiUMCM66nzgzA1/BieKKw3aLbw5GUvlcg==; 20:bxb7DuZrJug9KPCmxHs/EC3DZqOJYW46VtJPg21qZi3C938WtAlifZ8NIe1grbHtgwyk1ySqFqB3cNKBnrlvmFRo3xBxXm+XzdDNgftQdBMIXRidoHXOFfmH9WoLu/FTqKWs4cX7Ekk4+c8datdHdatEFFP1IfA7GyodcRdavqFpSnbQxDsqgoBZSvVdzsV8ERmRPIgQgOlHvb2lmJC+s0rSC9ltprLfIU345QI67k8Q4f7XlMTgtC7vtEuThrMJ x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0402; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(60795455431006)(180628864354917)(31051911155226)(9452136761055)(767451399110)(211936372134217)(217544274631240)(7411616537696)(228905959029699)(17755550239193); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BLUPR12MB0402; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0402; x-forefront-prvs: 0970508454 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(12213003)(27574002)(53434003)(13464003)(377454003)(24454002)(189002)(199003)(11100500001)(33656002)(66066001)(512874002)(99286002)(5008740100001)(450100001)(8676002)(4326007)(81166006)(81156014)(74316001)(105586002)(10400500002)(106356001)(5004730100002)(122556002)(229853001)(2351001)(97736004)(110136002)(189998001)(3660700001)(86362001)(3280700002)(9686002)(2501003)(87936001)(5003600100002)(575784001)(2900100001)(31430400001)(2906002)(101416001)(5002640100001)(50986999)(68736007)(6116002)(102836003)(3846002)(586003)(8936002)(54356999)(76576001)(77096005)(19580395003)(19580405001)(15975445007)(92566002)(579004); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0402; H:BLUPR12MB0401.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Jun 2016 13:50:17.2832 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0402 Cc: "Deucher, Alexander" , "Lysenko, Mykola" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi. Just a reminder with regard to this patch. Please comment if any changes are required. Thanks. -----Original Message----- From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of dri-devel-request@lists.freedesktop.org Sent: Wednesday, May 18, 2016 7:10 PM To: dri-devel@lists.freedesktop.org Subject: dri-devel Digest, Vol 74, Issue 285 Send dri-devel mailing list submissions to dri-devel@lists.freedesktop.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.freedesktop.org/mailman/listinfo/dri-devel or, via email, send a message with subject or body 'help' to dri-devel-request@lists.freedesktop.org You can reach the person managing the list at dri-devel-owner@lists.freedesktop.org When replying, please edit your Subject line so it is more specific than "Re: Contents of dri-devel digest..." Today's Topics: 1. Re: [PATCH] drm: Nuke ->vblank_disable_allowed (Alex Deucher) 2. Re: [PATCH 1/2] dma-buf/fence: add fence_collection fences (Chris Wilson) 3. drm/dp/mst: change MST detection scheme (v2) (Andrey Grodzovsky) ---------------------------------------------------------------------- Message: 1 Date: Wed, 18 May 2016 17:54:50 -0400 From: Alex Deucher To: Daniel Vetter Cc: Laurent Pinchart , Intel Graphics Development , Liviu Dudau , DRI Development , Tomi Valkeinen , Russell King , Alex Deucher , Daniel Vetter Subject: Re: [PATCH] drm: Nuke ->vblank_disable_allowed Message-ID: Content-Type: text/plain; charset=UTF-8 On Wed, May 18, 2016 at 4:29 PM, Daniel Vetter wrote: > This was added in > > commit 0a3e67a4caac273a3bfc4ced3da364830b1ab241 > Author: Jesse Barnes > Date: Tue Sep 30 12:14:26 2008 -0700 > > drm: Rework vblank-wait handling to allow interrupt reduction. > > to stay backwards-compatible with old UMS code that didn't even tell > the kernel when it did a modeset, so that the kernel could > save/restore vblank counters. At worst this means vblanks will be > somewhat funky on a setup that very likely no one still runs. > > So let's just nuke it. > > Plan B would be to set it unconditionally in drm_vblank_init for kms > drivers, instead of in each driver separately. So if this patch breaks > anything please only restore the hunks in drmP.h and drm_irq.c, plus > add a check for DRIVER_MODESET in drm_vblank_init. > > Stumbled over this in a discussion on irc with Chris. > > v2: Remove leftover debug gunk from psr hacking (Alex). > > Cc: Chris Wilson > Cc: Alex Deucher > Cc: Liviu Dudau > Cc: Russell King > Cc: Thierry Reding > Cc: Eric Anholt > Cc: Laurent Pinchart > Cc: Inki Dae > Cc: Tomi Valkeinen > Cc: Mark Yao > Cc: Sascha Hauer > Cc: Philipp Zabel > Signed-off-by: Daniel Vetter Seems reasonable to me. Reviewed-by: Alex Deucher > --- > drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 1 - > drivers/gpu/drm/arm/hdlcd_drv.c | 1 - > drivers/gpu/drm/armada/armada_drv.c | 1 - > drivers/gpu/drm/drm_irq.c | 6 ------ > drivers/gpu/drm/exynos/exynos_drm_drv.c | 7 ------- > drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c | 1 - > drivers/gpu/drm/gma500/psb_drv.c | 1 - > drivers/gpu/drm/i915/i915_dma.c | 3 --- > drivers/gpu/drm/imx/imx-drm-core.c | 7 ------- > drivers/gpu/drm/radeon/radeon_irq_kms.c | 1 - > drivers/gpu/drm/rockchip/rockchip_drm_drv.c | 7 ------- > drivers/gpu/drm/tegra/drm.c | 1 - > drivers/gpu/drm/vc4/vc4_kms.c | 2 -- > include/drm/drmP.h | 8 -------- > 14 files changed, 47 deletions(-) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c > index 9266c7b69808..835a3fa8d8df 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c > @@ -219,7 +219,6 @@ int amdgpu_irq_init(struct amdgpu_device *adev) > if (r) { > return r; > } > - adev->ddev->vblank_disable_allowed = true; > > /* enable msi */ > adev->irq.msi_enabled = false; diff --git > a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c > index 2112f0b105e3..4f909378d581 100644 > --- a/drivers/gpu/drm/arm/hdlcd_drv.c > +++ b/drivers/gpu/drm/arm/hdlcd_drv.c > @@ -379,7 +379,6 @@ static int hdlcd_drm_bind(struct device *dev) > DRM_ERROR("failed to initialise vblank\n"); > goto err_vblank; > } > - drm->vblank_disable_allowed = true; > > drm_mode_config_reset(drm); > drm_kms_helper_poll_init(drm); diff --git > a/drivers/gpu/drm/armada/armada_drv.c > b/drivers/gpu/drm/armada/armada_drv.c > index 531fcb946346..cb21c0b6374a 100644 > --- a/drivers/gpu/drm/armada/armada_drv.c > +++ b/drivers/gpu/drm/armada/armada_drv.c > @@ -113,7 +113,6 @@ static int armada_drm_load(struct drm_device *dev, unsigned long flags) > goto err_comp; > > dev->irq_enabled = true; > - dev->vblank_disable_allowed = 1; > > ret = armada_fbdev_init(dev); > if (ret) > diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c > index d1b5fc20b2f8..1a0ae89087e8 100644 > --- a/drivers/gpu/drm/drm_irq.c > +++ b/drivers/gpu/drm/drm_irq.c > @@ -348,9 +348,6 @@ static void vblank_disable_fn(unsigned long arg) > unsigned int pipe = vblank->pipe; > unsigned long irqflags; > > - if (!dev->vblank_disable_allowed) > - return; > - > spin_lock_irqsave(&dev->vbl_lock, irqflags); > if (atomic_read(&vblank->refcount) == 0 && vblank->enabled) { > DRM_DEBUG("disabling vblank on crtc %u\n", pipe); @@ > -437,8 +434,6 @@ int drm_vblank_init(struct drm_device *dev, unsigned int num_crtcs) > "get_vblank_timestamp == NULL\n"); > } > > - dev->vblank_disable_allowed = false; > - > return 0; > > err: > @@ -1555,7 +1550,6 @@ static void > drm_legacy_vblank_post_modeset(struct drm_device *dev, > > if (vblank->inmodeset) { > spin_lock_irqsave(&dev->vbl_lock, irqflags); > - dev->vblank_disable_allowed = true; > drm_reset_vblank_timestamp(dev, pipe); > spin_unlock_irqrestore(&dev->vbl_lock, irqflags); > > diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c > b/drivers/gpu/drm/exynos/exynos_drm_drv.c > index 21c719e8e02b..2dd820e23b0c 100644 > --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c > +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c > @@ -212,13 +212,6 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) > */ > dev->irq_enabled = true; > > - /* > - * with vblank_disable_allowed = true, vblank interrupt will be disabled > - * by drm timer once a current process gives up ownership of > - * vblank event.(after drm_vblank_put function is called) > - */ > - dev->vblank_disable_allowed = true; > - > /* init kms poll for handling hpd */ > drm_kms_helper_poll_init(dev); > > diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > index 2e58dfd74ae1..33727d5d826a 100644 > --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c > @@ -80,7 +80,6 @@ static int fsl_dcu_load(struct drm_device *dev, unsigned long flags) > dev_err(dev->dev, "failed to initialize vblank\n"); > goto done; > } > - dev->vblank_disable_allowed = true; > > ret = fsl_dcu_drm_irq_init(dev); > if (ret < 0) > diff --git a/drivers/gpu/drm/gma500/psb_drv.c > b/drivers/gpu/drm/gma500/psb_drv.c > index 4e1c6850520e..82b8ce418b27 100644 > --- a/drivers/gpu/drm/gma500/psb_drv.c > +++ b/drivers/gpu/drm/gma500/psb_drv.c > @@ -374,7 +374,6 @@ static int psb_driver_load(struct drm_device *dev, > unsigned long flags) > > drm_irq_install(dev, dev->pdev->irq); > > - dev->vblank_disable_allowed = true; > dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ > dev->driver->get_vblank_counter = psb_get_vblank_counter; > > diff --git a/drivers/gpu/drm/i915/i915_dma.c > b/drivers/gpu/drm/i915/i915_dma.c index a8c79f6512a4..fd06bff216ff > 100644 > --- a/drivers/gpu/drm/i915/i915_dma.c > +++ b/drivers/gpu/drm/i915/i915_dma.c > @@ -515,9 +515,6 @@ static int i915_load_modeset_init(struct > drm_device *dev) > > intel_modeset_gem_init(dev); > > - /* Always safe in the mode setting case. */ > - /* FIXME: do pre/post-mode set stuff in core KMS code */ > - dev->vblank_disable_allowed = true; > if (INTEL_INFO(dev)->num_pipes == 0) > return 0; > > diff --git a/drivers/gpu/drm/imx/imx-drm-core.c > b/drivers/gpu/drm/imx/imx-drm-core.c > index 2453fb1c68a7..1080019e7b17 100644 > --- a/drivers/gpu/drm/imx/imx-drm-core.c > +++ b/drivers/gpu/drm/imx/imx-drm-core.c > @@ -252,13 +252,6 @@ static int imx_drm_driver_load(struct drm_device *drm, unsigned long flags) > if (ret) > goto err_kms; > > - /* > - * with vblank_disable_allowed = true, vblank interrupt will be > - * disabled by drm timer once a current process gives up ownership > - * of vblank event. (after drm_vblank_put function is called) > - */ > - drm->vblank_disable_allowed = true; > - > platform_set_drvdata(drm->platformdev, drm); > > /* Now try and bind all our sub-components */ diff --git > a/drivers/gpu/drm/radeon/radeon_irq_kms.c > b/drivers/gpu/drm/radeon/radeon_irq_kms.c > index 1e9304d1c88f..c084cadcbf21 100644 > --- a/drivers/gpu/drm/radeon/radeon_irq_kms.c > +++ b/drivers/gpu/drm/radeon/radeon_irq_kms.c > @@ -291,7 +291,6 @@ int radeon_irq_kms_init(struct radeon_device *rdev) > if (r) { > return r; > } > - rdev->ddev->vblank_disable_allowed = true; > > /* enable msi */ > rdev->msi_enabled = 0; > diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > index ced1e5f93cda..09a4d429c0f0 100644 > --- a/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > +++ b/drivers/gpu/drm/rockchip/rockchip_drm_drv.c > @@ -217,13 +217,6 @@ static int rockchip_drm_load(struct drm_device *drm_dev, unsigned long flags) > if (ret) > goto err_kms_helper_poll_fini; > > - /* > - * with vblank_disable_allowed = true, vblank interrupt will be disabled > - * by drm timer once a current process gives up ownership of > - * vblank event.(after drm_vblank_put function is called) > - */ > - drm_dev->vblank_disable_allowed = true; > - > drm_mode_config_reset(drm_dev); > > ret = rockchip_drm_fbdev_init(drm_dev); diff --git > a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index > 679905544181..b59c3bf0df44 100644 > --- a/drivers/gpu/drm/tegra/drm.c > +++ b/drivers/gpu/drm/tegra/drm.c > @@ -180,7 +180,6 @@ static int tegra_drm_load(struct drm_device *drm, > unsigned long flags) > > /* syncpoints are used for full 32-bit hardware VBLANK counters */ > drm->max_vblank_count = 0xffffffff; > - drm->vblank_disable_allowed = true; > > err = drm_vblank_init(drm, drm->mode_config.num_crtc); > if (err < 0) > diff --git a/drivers/gpu/drm/vc4/vc4_kms.c > b/drivers/gpu/drm/vc4/vc4_kms.c index d423ba10239a..cb37751bc99f > 100644 > --- a/drivers/gpu/drm/vc4/vc4_kms.c > +++ b/drivers/gpu/drm/vc4/vc4_kms.c > @@ -207,8 +207,6 @@ int vc4_kms_load(struct drm_device *dev) > dev->mode_config.preferred_depth = 24; > dev->mode_config.async_page_flip = true; > > - dev->vblank_disable_allowed = true; > - > drm_mode_config_reset(dev); > > vc4->fbdev = drm_fbdev_cma_init(dev, 32, diff --git > a/include/drm/drmP.h b/include/drm/drmP.h index > f0d1450d4ea5..30dc7d8c403f 100644 > --- a/include/drm/drmP.h > +++ b/include/drm/drmP.h > @@ -819,14 +819,6 @@ struct drm_device { > int irq; > > /* > - * At load time, disabling the vblank interrupt won't be allowed since > - * old clients may not call the modeset ioctl and therefore misbehave. > - * Once the modeset ioctl *has* been called though, we can safely > - * disable them when unused. > - */ > - bool vblank_disable_allowed; > - > - /* > * If true, vblank interrupt will be disabled immediately when the > * refcount drops to zero, as opposed to via the vblank disable > * timer. > -- > 2.8.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ------------------------------ Message: 2 Date: Wed, 18 May 2016 23:57:10 +0100 From: Chris Wilson To: Gustavo Padovan Cc: marcheu@google.com, Daniel Stone , seanpaul@google.com, Daniel Vetter , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, laurent.pinchart@ideasonboard.com, Alex Deucher , Gustavo Padovan , Christian König , John Harrison , m.chehab@samsung.com Subject: Re: [PATCH 1/2] dma-buf/fence: add fence_collection fences Message-ID: <20160518225710.GA32627@nuc-i3427.alporthouse.com> Content-Type: text/plain; charset=us-ascii On Wed, May 18, 2016 at 05:59:52PM -0300, Gustavo Padovan wrote: > +static void collection_check_cb_func(struct fence *fence, struct > +fence_cb *cb) { > + struct fence_collection_cb *f_cb; > + struct fence_collection *collection; > + > + f_cb = container_of(cb, struct fence_collection_cb, cb); > + collection = f_cb->collection; > + > + if (atomic_dec_and_test(&collection->num_pending_fences)) > + fence_signal(&collection->base); > +} > + > +static bool fence_collection_enable_signaling(struct fence *fence) { > + struct fence_collection *collection = to_fence_collection(fence); > + int i; > + > + for (i = 0 ; i < collection->num_fences ; i++) { > + if (fence_add_callback(collection->fences[i].fence, > + &collection->fences[i].cb, > + collection_check_cb_func)) { > + atomic_dec(&collection->num_pending_fences); > + } > + } We don't always have a convenient means to preallocate an array of fences to use. Keeping a list of fences in addition to the array would be easier to user in many circumstances. Just means we need a struct fence_collection_entry { struct fence *fence; struct list_head link; }; int fence_collection_add(struct fence *_collection, struct fence *fence) { struct fence_collection *collection = to_fence_collection(_collection); struct fence_collection_entry *entry; entry = kmalloc(sizeof(*entry), GFP_KERNEL); if (!entry) return -ENOMEM; entry->fence = fence_get(fence); list_add_tail(&entry->link, &collection->fence_list); atomic_inc(&collection->num_pending_fences); return 0; } and a couple of list iterations as well as walking the arrays. (This fence_collection_add() needs to be documented to only be valid from the constructing thread before the fence is sealed for export/use.) -Chris --- Chris Wilson, Intel Open Source Technology Centre HI. ------------------------------ Message: 3 Date: Wed, 18 May 2016 18:37:10 -0400 From: Andrey Grodzovsky To: Cc: Mykola Lysenko Subject: drm/dp/mst: change MST detection scheme (v2) Message-ID: <1463611030-21448-1-git-send-email-Andrey.Grodzovsky@amd.com> Content-Type: text/plain; charset="UTF-8" From: Mykola Lysenko 1. Get edid for all connected MST displays, not only on logical ports, in the same thread as MST topology detection is done: There are displays that have branches inside w/o logical ports. So in case another SST display connected downstream system can end-up in situation when 3 DOWN requests sent: two for ‘remote i2c read’ and one for ‘enum path resources’, making slots full. 2. Call notification callback in one place in the end of topology discovery/update: This is done to reduce number of events sent to userspace in case complex topology discovery is going, adding multiple number of connectors; 3. Remove notification callback call from short pulse interrupt processing function: This is done in order not to block interrupt processing function, in case any MST request will be made from it. Notification will be send from topology discovery/update work item. v2: This change also includes tile property set fix which caused regression in i915 driver. Reviewed-by: Alex Deucher Signed-off-by: Mykola Lysenko --- drivers/gpu/drm/drm_dp_mst_topology.c | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) -- 1.9.1 ------------------------------ Subject: Digest Footer _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ------------------------------ End of dri-devel Digest, Vol 74, Issue 285 ****************************************** diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 27fbd79..9971c46 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1159,13 +1159,9 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, drm_dp_put_port(port); goto out; } - if (port->port_num >= DP_MST_LOGICAL_PORT_0) { - port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc); - drm_mode_connector_set_tile_property(port->connector); - } + (*mstb->mgr->cbs->register_connector)(port->connector); } - out: /* put reference to this port */ drm_dp_put_port(port); @@ -1190,8 +1186,8 @@ static void drm_dp_update_port(struct drm_dp_mst_branch *mstb, port->ddps = conn_stat->displayport_device_plug_status; if (old_ddps != port->ddps) { + dowork = true; if (port->ddps) { - dowork = true; } else { port->available_pbn = 0; } @@ -1296,8 +1292,13 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m if (port->input) continue; - if (!port->ddps) + if (!port->ddps) { + if (port->cached_edid) { + kfree(port->cached_edid); + port->cached_edid = NULL; + } continue; + } if (!port->available_pbn) drm_dp_send_enum_path_resources(mgr, mstb, port); @@ -1308,6 +1309,13 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m drm_dp_check_and_send_link_address(mgr, mstb_child); drm_dp_put_mst_branch_device(mstb_child); } + } else if (port->pdt == DP_PEER_DEVICE_SST_SINK || + port->pdt == DP_PEER_DEVICE_DP_LEGACY_CONV) { + if (!port->cached_edid) { + port->cached_edid = + drm_get_edid(port->connector, &port->aux.ddc); + drm_mode_connector_set_tile_property(port->connector); + } } } } @@ -1327,6 +1335,8 @@ static void drm_dp_mst_link_probe_work(struct work_struct *work) drm_dp_check_and_send_link_address(mgr, mstb); drm_dp_put_mst_branch_device(mstb); } + + (*mgr->cbs->hotplug)(mgr); } static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, @@ -1586,7 +1596,6 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, for (i = 0; i < txmsg->reply.u.link_addr.nports; i++) { drm_dp_add_port(mstb, mgr->dev, &txmsg->reply.u.link_addr.ports[i]); } - (*mgr->cbs->hotplug)(mgr); } } else { mstb->link_address_sent = false; @@ -2283,8 +2292,6 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) drm_dp_update_port(mstb, &msg.u.conn_stat); DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displayport_device_plug_status, msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port, msg.u.conn_stat.peer_device_type); - (*mgr->cbs->hotplug)(mgr); - } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); if (!mstb) @@ -2371,10 +2378,6 @@ enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector *connector case DP_PEER_DEVICE_SST_SINK: status = connector_status_connected; - /* for logical ports - cache the EDID */ - if (port->port_num >= 8 && !port->cached_edid) { - port->cached_edid = drm_get_edid(connector, &port->aux.ddc); - } break; case DP_PEER_DEVICE_DP_LEGACY_CONV: if (port->ldps) @@ -2429,10 +2432,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_ if (port->cached_edid) edid = drm_edid_duplicate(port->cached_edid); - else { - edid = drm_get_edid(connector, &port->aux.ddc); - drm_mode_connector_set_tile_property(connector); - } + port->has_audio = drm_detect_monitor_audio(edid); drm_dp_put_port(port); return edid;