From patchwork Wed Aug 14 18:46:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 171340 Delivered-To: patches@linaro.org Received: by 2002:a92:d204:0:0:0:0:0 with SMTP id y4csp1203134ily; Wed, 14 Aug 2019 11:47:24 -0700 (PDT) X-Received: by 2002:a63:e901:: with SMTP id i1mr449056pgh.451.1565808444507; Wed, 14 Aug 2019 11:47:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565808444; cv=none; d=google.com; s=arc-20160816; b=nqN7wx4e5opY3JMIpiiD+VyU7oQ6lRBSj27k/Beyu+eMSxvJs6wbtjpF5THuJt+LyM P0gcrl79D8LH9tmKbxwb1I2f9JcyZECjpamtUnxMPdoNXR/mUWJf/lWrwflLGpXoJPck YeHU0Ohs0jH6UUwpmj0yvKr43cwcz5BaAecycDwzgnvzsSbqNy0pTXwyUFXPLuh8Hr7A clpnnaja1I+lnlfku05HWdb4uO/+s00/iHtQb+wSzeW/aciBa4uMea7UHkamjR9lWHRg A2jpzf6zpten5dmi9rPvuRBqb2QCrVmLDUxguriHmT+HZeszPkUbeTKZz8AKBVLSYz/w ea8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=oF/wbsoL0VS/wbGpdQ82+BUReXpcSGsjNr6ZOoxveCE=; b=DzezC4JDZOneNJ8nUQ8Afh1uhwX8riSYbc++RncV3sY2r/mGU12OScrmGCcZH40WF3 CG15pHL/FVQt4M6txRKfM0zayjFVUj7BzRCdMxJgmMOnG2ejw49cHOhGRXEA2G3pCVpA 0jblyOM20l17joGqKahxvgvP94VE2JaZ6pZ9dYGFRMVXk9TRitw1264HJNnAEwYLMoNO /XwM/kjxtiIoFpO0jcEbAYN1sOSGsogW/7xxnysaqroK6/kjT7hoJzNJ0J9Rj+mndjBJ 3pprNEoKVjobF//bAJxBYgnLLbmNNa4P7/2EF5KpNIOMEdSj942KNbpyT+X6QS9ZiPBs QD1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fbE+WUXe; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id l13sor412479pgq.30.2019.08.14.11.47.24 for (Google Transport Security); Wed, 14 Aug 2019 11:47:24 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fbE+WUXe; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=oF/wbsoL0VS/wbGpdQ82+BUReXpcSGsjNr6ZOoxveCE=; b=fbE+WUXen307U/StI9D2O7GIdMzehRpD6EtZen5vznPou1FPyMwl/2Xxzt4nMi0Wa8 rcWMpKaVL9QJEqXN1S1DhwMt81wV9iG1G/6oKUsCcVJ5yLGNWbBn2ED85dp96DmG8N5Y 3+MAEKD7CVRKwn5TU2L+IcKTbCd99tingrjVosZlgwpzyfITUpDY0VnmL4vTXg2ojAWI Fq6dpbIOcMiD7DsNZ/R2k3ON8TyRwH0VP+IYRWl9UmU1cf1YzSoAv6oGBf29neQ31Lvq 7gUwiKmxVzWTxufpHByAIwKdCWpsjinRfA/5l5yIUNiE8pnt6qG+KCo/eXCYHWwOTyQg yk2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=oF/wbsoL0VS/wbGpdQ82+BUReXpcSGsjNr6ZOoxveCE=; b=WWI6TdtXLsy18q0hvSiyvdrR7r9ShDkklP0rn7ikCEjiFocc2LW3FYx2D19F6YL0t9 ZbYkUvDWvCDeVG0iAPN/B1vBttHc/RGk3koMxa262W69WcG0l8sjIlWvmSpi9p7r+YtD GeR2c8Uv7EaP3BhlZLP3VPW//vlbdrQZNqOMBjOLV/gNV3lQC2fpMeLaZisE/ziTSH8s 8pQ+CTxV+YfJQyczs7HavR/lWUvhFWRIBWDQaWw9liUBythpZEw/CmbkGyhOSNW1Ng6V XWqiGiXIQIvfgQlRlLDxrJKAmK6zMMl7pWl4hqitLd113f3u69STMXUM7mtxHUmy8DX/ /+gA== X-Gm-Message-State: APjAAAXd0GwMDr4YeVRXxZgzgw5MVHTNHYTLC/XU0+h3UYYGJMOekRVp BOY/qLzdzznqTCSSiR3GyJXrfwWv X-Google-Smtp-Source: APXvYqxwrcP6tgZ+Cn/BGiRQhmX25xrIEbmdHjEGFfzqljCsAWuX2UCiX97DGxggqL+Pgk1BdiMUpA== X-Received: by 2002:a63:b346:: with SMTP id x6mr519112pgt.218.1565808443994; Wed, 14 Aug 2019 11:47:23 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:692:26ff:feda:3a81]) by smtp.gmail.com with ESMTPSA id y16sm610855pfc.36.2019.08.14.11.47.22 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 11:47:23 -0700 (PDT) From: John Stultz To: lkml Cc: John Stultz , Rongrong Zou , Xinliang Liu , David Airlie , Daniel Vetter , dri-devel , Sam Ravnborg Subject: [RESEND][PATCH v3 11/26] drm: kirin: Move workqueue to ade_hw_ctx structure Date: Wed, 14 Aug 2019 18:46:47 +0000 Message-Id: <20190814184702.54275-12-john.stultz@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190814184702.54275-1-john.stultz@linaro.org> References: <20190814184702.54275-1-john.stultz@linaro.org> The workqueue used to reset the display when we hit an LDI underflow error is ADE specific, so since this patch series works to make the kirin_crtc structure more generic, move the workqueue to the ade_hw_ctx structure instead. Cc: Rongrong Zou Cc: Xinliang Liu Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel Cc: Sam Ravnborg Reviewed-by: Sam Ravnborg Signed-off-by: John Stultz --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 0e0fe1cb945f..ec4857e45b6e 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -52,6 +52,7 @@ struct ade_hw_ctx { struct clk *media_noc_clk; struct clk *ade_pix_clk; struct reset_control *reset; + struct work_struct display_reset_wq; bool power_on; int irq; @@ -61,7 +62,6 @@ struct ade_hw_ctx { struct kirin_crtc { struct drm_crtc base; void *hw_ctx; - struct work_struct display_reset_wq; bool enable; }; @@ -349,9 +349,9 @@ static void ade_crtc_disable_vblank(struct drm_crtc *crtc) static void drm_underflow_wq(struct work_struct *work) { - struct kirin_crtc *acrtc = container_of(work, struct kirin_crtc, + struct ade_hw_ctx *ctx = container_of(work, struct ade_hw_ctx, display_reset_wq); - struct drm_device *drm_dev = (&acrtc->base)->dev; + struct drm_device *drm_dev = ctx->crtc->dev; struct drm_atomic_state *state; state = drm_atomic_helper_suspend(drm_dev); @@ -362,7 +362,6 @@ static irqreturn_t ade_irq_handler(int irq, void *data) { struct ade_hw_ctx *ctx = data; struct drm_crtc *crtc = ctx->crtc; - struct kirin_crtc *kcrtc = to_kirin_crtc(crtc); void __iomem *base = ctx->base; u32 status; @@ -379,7 +378,7 @@ static irqreturn_t ade_irq_handler(int irq, void *data) ade_update_bits(base + LDI_INT_CLR, UNDERFLOW_INT_EN_OFST, MASK(1), 1); DRM_ERROR("LDI underflow!"); - schedule_work(&kcrtc->display_reset_wq); + schedule_work(&ctx->display_reset_wq); } return IRQ_HANDLED; @@ -1016,6 +1015,7 @@ static void *ade_hw_ctx_alloc(struct platform_device *pdev, if (ret) return ERR_PTR(-EIO); + INIT_WORK(&ctx->display_reset_wq, drm_underflow_wq); ctx->crtc = crtc; return ctx; @@ -1071,8 +1071,6 @@ static int ade_drm_init(struct platform_device *pdev) if (ret) return ret; - INIT_WORK(&kcrtc->display_reset_wq, drm_underflow_wq); - return 0; }