From patchwork Mon May 20 12:12:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 797895 Received: from mail-lf1-f49.google.com (mail-lf1-f49.google.com [209.85.167.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C445E53E2D for ; Mon, 20 May 2024 12:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716207171; cv=none; b=g+hfIh5R6beS5r8vyo4ke3H56/+oNO4qY4rXGY9Bmhh1eGpWIuMVV275F3RmORBagsU9/C0sNQsJOtt4fjt6qGFIYaG9jc8cY9SULcaEhudomoqHonNKYY+pfOirB5+wAWUyFj3jiefgZx6Y5QGAUAJSGvW+4iVz9McSAQYFNm4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716207171; c=relaxed/simple; bh=J8Xb1/I3EmuS+Y/A0WKJ5x+Y52MqFdPOqf+7n3dQ3/c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YHM/8lBBqGU7K9CyBQxOLpmhsUdswvZqdY1pAXVyfRrr18T0WMpIknN8me6hKcTRIcnetHtdKgfaZWdDu6YT9lNL1Cf54Vp/ocV3ICB5ULbRclBFzEWkDG9V2+1UytGhWfx6vyh7iHlYuVHzQAoxObAh3H3k+W604bpzhhkLK0o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=wwFwAhN2; arc=none smtp.client-ip=209.85.167.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wwFwAhN2" Received: by mail-lf1-f49.google.com with SMTP id 2adb3069b0e04-52449b7aa2bso914300e87.3 for ; Mon, 20 May 2024 05:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716207168; x=1716811968; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=azCAUbP81p6FXz3Lrf7UeBHi+32GPaYrpMLE7+SkPh0=; b=wwFwAhN2DG6Govlck0RQRrd6xAUrmFJE5pH/vQnaUSpLgtbukKB1gTeiqqB53F/RCv L//rEQoXzJewazCatC4mJeoA7epI6z8RxJCVsOhOtXCSUDSXI3vlf8xo21SMJBKEAxX7 hAUCwe/CZPriC7H2pPr7n8mEiK3wVOtJXVzqqfRuxH/9ldzWSaWkPppDFCt6dpIK4+VM 1tNH2fz/QxsAtbJZLhGsg/AuPGYt9fQvxbaaLEeH76/lhHYHhk58/82M9G/akq649LcN Aw457asw9sDTDq+jVXDmKswm5d5RQaGJsXJ8+zWTQ7mYCQq4LoxDaV5wx8tvIUSwnWok 1iCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716207168; x=1716811968; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=azCAUbP81p6FXz3Lrf7UeBHi+32GPaYrpMLE7+SkPh0=; b=pSq2MgcldQ3rJihRxqeJ+oAE/H8PN7CXz0VNp6+5WDFbLtMozIvrzWKIEPFXzcvf9k /cUUmyNwEbF51Dm+FnGsen0wcDWYCBBgYL0ElO8bwirfAYi4LXvwi/8l4yAo1fETaFtb wFhS9sUkwM84PUQvM0PIKVeOrWJBZi1FIWLFIzOEp7VUtCYEgVGYskJlDnxNIWIS9Epj SypSa0TFLadmjM7hb5xtJWyx1iJKfeIia2bcxd8H3Lf+LyjywEIyQmN5bg0TfAm7/aca tFGGB8l5MqEsB0ZS0IJXnatQ6YsP4QQdffwo4cHKpa/xuMEXbrl79IrgurcBUeVhzCIm gu9g== X-Gm-Message-State: AOJu0YxWGyxeFhok0cbAbGtUJE8qV5J6Ljxf6nPWNZkQKZH6dnVblejE 9LG4l+IsxxudVP2lT+26Yejq7rrBI7bevBG4fpnzBpqLQsetehipxDGLl0NQyyg= X-Google-Smtp-Source: AGHT+IFHXDg+EVY96/TXoydluRSvx4tfTtHcuReGqwXRhizYWJfHYfKjYmaD7LxLO00+dtpo3Ayx1g== X-Received: by 2002:a05:6512:1386:b0:51d:aae8:646 with SMTP id 2adb3069b0e04-5220fb7671fmr24010121e87.11.1716207167999; Mon, 20 May 2024 05:12:47 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f35ad6c0sm4273682e87.30.2024.05.20.05.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 05:12:47 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 20 May 2024 15:12:44 +0300 Subject: [PATCH 2/7] drm/msm/dpu: convert vsync source defines to the enum Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240520-dpu-handle-te-signal-v1-2-f273b42a089c@linaro.org> References: <20240520-dpu-handle-te-signal-v1-0-f273b42a089c@linaro.org> In-Reply-To: <20240520-dpu-handle-te-signal-v1-0-f273b42a089c@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3962; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=J8Xb1/I3EmuS+Y/A0WKJ5x+Y52MqFdPOqf+7n3dQ3/c=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmSz48m8V7fkZ7xpTmWfwckD/lkB5CTS/3Sbupp RcBptnAar6JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZks+PAAKCRCLPIo+Aiko 1aacCACnwDVWWZYxOsZbcmthWWJS6loboPeeug/ROWmbTwwjN10uUUwWW0eu2lybLGygqkmy3W7 QKHxF1p+W5nO1sh5Pa9Qk2HeYNDXpFR+nrq75nOspJ9zpcKzhxzykvT0q1XVWdPo6lXPFXoaZM5 PQzA9UnhBW/7FBKuXtWXsDy3fmw0eJTOQqPuan8YbS8tWku9NL4nrSUJfS2WUkv63KFVHVGmMMW 58CcML6DyJhjjSF1QwtdOrMVHno/dZK98oNQ+9z8SeVvK8FOcTIKZSSFVMcB6R2JXOTQyvdjYmH oJes68AqV53eIzoJrLnSt1TL26CHugIboG9SW4bvDRnXGZp3 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Add enum dpu_vsync_source instead of a series of defines. Use this enum to pass vsync information. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h | 2 +- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h | 26 ++++++++++++++------------ drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h | 2 +- 5 files changed, 18 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 119f3ea50a7c..4988a1029431 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -747,7 +747,7 @@ static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc, if (disp_info->is_te_using_watchdog_timer) vsync_cfg.vsync_source = DPU_VSYNC_SOURCE_WD_TIMER_0; else - vsync_cfg.vsync_source = DPU_VSYNC0_SOURCE_GPIO; + vsync_cfg.vsync_source = DPU_VSYNC_SOURCE_GPIO_0; hw_mdptop->ops.setup_vsync_source(hw_mdptop, &vsync_cfg); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c index 225c1c7768ff..96f6160cf607 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c @@ -462,7 +462,7 @@ static int dpu_hw_intf_get_vsync_info(struct dpu_hw_intf *intf, } static void dpu_hw_intf_vsync_sel(struct dpu_hw_intf *intf, - u32 vsync_source) + enum dpu_vsync_source vsync_source) { struct dpu_hw_blk_reg_map *c; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h index f9015c67a574..ac244f0b33fb 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.h @@ -107,7 +107,7 @@ struct dpu_hw_intf_ops { int (*connect_external_te)(struct dpu_hw_intf *intf, bool enable_external_te); - void (*vsync_sel)(struct dpu_hw_intf *intf, u32 vsync_source); + void (*vsync_sel)(struct dpu_hw_intf *intf, enum dpu_vsync_source vsync_source); /** * Disable autorefresh if enabled diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h index 66759623fc42..a2eff36a2224 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h @@ -54,18 +54,20 @@ #define DPU_BLEND_BG_INV_MOD_ALPHA (1 << 12) #define DPU_BLEND_BG_TRANSP_EN (1 << 13) -#define DPU_VSYNC0_SOURCE_GPIO 0 -#define DPU_VSYNC1_SOURCE_GPIO 1 -#define DPU_VSYNC2_SOURCE_GPIO 2 -#define DPU_VSYNC_SOURCE_INTF_0 3 -#define DPU_VSYNC_SOURCE_INTF_1 4 -#define DPU_VSYNC_SOURCE_INTF_2 5 -#define DPU_VSYNC_SOURCE_INTF_3 6 -#define DPU_VSYNC_SOURCE_WD_TIMER_4 11 -#define DPU_VSYNC_SOURCE_WD_TIMER_3 12 -#define DPU_VSYNC_SOURCE_WD_TIMER_2 13 -#define DPU_VSYNC_SOURCE_WD_TIMER_1 14 -#define DPU_VSYNC_SOURCE_WD_TIMER_0 15 +enum dpu_vsync_source { + DPU_VSYNC_SOURCE_GPIO_0, + DPU_VSYNC_SOURCE_GPIO_1, + DPU_VSYNC_SOURCE_GPIO_2, + DPU_VSYNC_SOURCE_INTF_0 = 3, + DPU_VSYNC_SOURCE_INTF_1, + DPU_VSYNC_SOURCE_INTF_2, + DPU_VSYNC_SOURCE_INTF_3, + DPU_VSYNC_SOURCE_WD_TIMER_4 = 11, + DPU_VSYNC_SOURCE_WD_TIMER_3, + DPU_VSYNC_SOURCE_WD_TIMER_2, + DPU_VSYNC_SOURCE_WD_TIMER_1, + DPU_VSYNC_SOURCE_WD_TIMER_0, +}; enum dpu_hw_blk_type { DPU_HW_BLK_TOP = 0, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h index 6f3dc98087df..5c9a7ede991e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_top.h @@ -64,7 +64,7 @@ struct dpu_vsync_source_cfg { u32 pp_count; u32 frame_rate; u32 ppnumber[PINGPONG_MAX]; - u32 vsync_source; + enum dpu_vsync_source vsync_source; }; /** From patchwork Mon May 20 12:12:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 797894 Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7106A53E25 for ; Mon, 20 May 2024 12:12:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716207173; cv=none; b=a0FsiEE2IbSW7AazInllaBQSJG2oIAw7K/M8CzOfPdDn0PKcmgmgugXczTDLhtXrNTYyYsHzeiEUTCjTWib3lBGVfUYVtPixtfC8E2mCfqXPQY1IAeEUJ0LDXFPGIJLRNJK7x372sBLU7PrVK0id2qASpPbIbkiubaCUf4pmHus= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716207173; c=relaxed/simple; bh=bDRD6hyOiwSp4TuqfrUKy12qF1U6aueui3oZOXjqlN4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=O+g22bgE7o4lTBZgHOCdKOuARBzAbvYaWQNuyQ8Wg4irKLTH+djsalAnycmcEhpn+mJdGQKfhGuMGr9t4AWFwaUBx4LNNdYBS9hrbcRJt1r2rYADx3LASd3bg29JzzGyMRXK5FoJWNtpp92rcUTFAyLR0M6YLEnunnIWvAMFgDc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=c8F3RVUM; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="c8F3RVUM" Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-51f72a29f13so3756449e87.3 for ; Mon, 20 May 2024 05:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716207170; x=1716811970; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=keee18vyiohjBfgyo9UKfbBA5sVKxKV1c/ETLbjaR9s=; b=c8F3RVUMMwGV/EBonHDaLLeJYjx8Hgk4iZa2AV6qoAu4jyaiNNMK/2qz11oIBPk10f goLZWR1LVVa/PJ23dLFNCZV0WCe55QagIH7yq57DaKGXx2MwBLXQN2knyD6trc2AtPJE moCR5m3OslfgXFXFEULfaALIYG5GgybLdty/TsvDuyR2P55iPWOyRTGcDc6rLco7Zl8v CDuJpj9kBzfZRgZEljoOhhoRlxXyG8NEBDn8pMNtHBjHvn5tnF32UHmBOPki3wzgkoC/ ft59k8duKZLoArc+yPx1+PAuPDfhyfaHqdIwUqiKMzbywgDMf2+V74oBuPkwkLLGrjM4 s1sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716207170; x=1716811970; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=keee18vyiohjBfgyo9UKfbBA5sVKxKV1c/ETLbjaR9s=; b=shDCDSanvZgt1vOMfgdJR6HzMfdFxcCbcpzYnKbenvk9935VKP02Xu5nHBZLG5HjSl gO/JRayMKPO1qgAAu/Mp6dnz8LZWj+8PfBZ+j+DV3Y9TEbcYmxg5/3xKx0X1w81zzFiv thzXPyMiLqrnMwcMRc80iMPcyn5UXxNsTYfrw22QIyapDhkWGgqgHKrHtO9Ti1FT296f nKv31RXEPFLOE2jHFxZNWtfJzxAHCCXI/yxA/Clu2MFej9aVxQaw6/hyYJLM9LF637/w tZNimaPFpWEKStIyd9You7RiPMwjd5ozjWADuXhmcsNfJYYGxAHI0zFzoLeu0GZ5hps/ eKbQ== X-Gm-Message-State: AOJu0Yzp8rLqjVCrduOwq6rWvTojj4B876uFd6C+n4Hv67Z7TfzuEpaT lvRt6PsajmZiTDbj4poHjyqAYx70UyGByAzNTfA9VIuRz5GqygL8vmk40r6m0Ks= X-Google-Smtp-Source: AGHT+IF6Mhvh250bABHjRxzDkj9uIsdB07MYJYgfIjq5uVOdCEnVKqMLdxmE8efNSAAbbYwjqx1KMg== X-Received: by 2002:ac2:58d6:0:b0:523:b371:7b78 with SMTP id 2adb3069b0e04-523b371837dmr8066261e87.13.1716207169840; Mon, 20 May 2024 05:12:49 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f35ad6c0sm4273682e87.30.2024.05.20.05.12.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 05:12:49 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 20 May 2024 15:12:46 +0300 Subject: [PATCH 4/7] drm/msm/dpu: pull the is_cmd_mode out of _dpu_encoder_update_vsync_source() Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240520-dpu-handle-te-signal-v1-4-f273b42a089c@linaro.org> References: <20240520-dpu-handle-te-signal-v1-0-f273b42a089c@linaro.org> In-Reply-To: <20240520-dpu-handle-te-signal-v1-0-f273b42a089c@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1424; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=bDRD6hyOiwSp4TuqfrUKy12qF1U6aueui3oZOXjqlN4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmSz48rPmBSdBCPNcr0Nq4uZbzKAxnCAn9+N3ua l3iyx2kyeWJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZks+PAAKCRCLPIo+Aiko 1SnOB/9b97fXE/ctQDf+BNb0r8haZVhTOA9gVVSIuS/CxtjyFcBl0xqbfoyy7HDqcYGQUXf96D5 DiVsXnnEdODCvHMy9wyBO8lfpq5DapeRB+XmkZ6X424lZGw3XPze2Fu8kwq9J9WyiMRf46decbk MByl5kttundXLDlIiXnJvr3XpYT9GyKK/zVxBQhlpJk5ufKWpedVWI5eAd0Oaw67u1aGBImeHDq u4Y9eUtxdvLUcP+jdog4B301ApzKvbYCHHEVtSe56Cen301dQL1pm7evN95Gwu5XWpNapC6bDHL Letok6pJO2uU40lXqYVjUWjzZkFOdepwnVMcAoYHantl5j75 X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Setting vsync source makes sense only for DSI CMD panels. Pull the is_cmd_mode condition out of the function into the calling code, so that it becomes more explicit. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 4988a1029431..bd37a56b4d03 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -736,8 +736,7 @@ static void _dpu_encoder_update_vsync_source(struct dpu_encoder_virt *dpu_enc, return; } - if (hw_mdptop->ops.setup_vsync_source && - disp_info->is_cmd_mode) { + if (hw_mdptop->ops.setup_vsync_source) { for (i = 0; i < dpu_enc->num_phys_encs; i++) vsync_cfg.ppnumber[i] = dpu_enc->hw_pp[i]->idx; @@ -1226,7 +1225,8 @@ static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc) dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select( dpu_enc->cur_master->hw_mdptop); - _dpu_encoder_update_vsync_source(dpu_enc, &dpu_enc->disp_info); + if (dpu_enc->disp_info.is_cmd_mode) + _dpu_encoder_update_vsync_source(dpu_enc, &dpu_enc->disp_info); if (dpu_enc->disp_info.intf_type == INTF_DSI && !WARN_ON(dpu_enc->num_phys_encs == 0)) { From patchwork Mon May 20 12:12:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 797893 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 043B855C35 for ; Mon, 20 May 2024 12:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716207174; cv=none; b=TZBtQKX2ajXsWGhqYzHKidIersYSc0MApUlIl//MBcwGP8UEhAE/O7URsIr/DhtUaAExCJ/UAgNtGjoZU3SS5cov7RkgIuUPPZKIrokng6OZj8QRWxNHI0M9ZKIZ9IbmSz6Yk+DLPripoJhxs+6xuux+1m4UHc8rwZGIfRIRuP8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716207174; c=relaxed/simple; bh=ZrM9buBF+7o6VFKWXROwO7MpIS2e3+tniUIcYb9S9j0=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XUJ5iysNcBj8q8mT+RMJxc6rf36t2tjNHDB821Jag130WmssxI78KQBXVhxIX1FHBd5OYkO9h6wNk/AaV5XH8e0xeNJqafwjxhdidaBEdUi4f6bhSXcF5y0hj+jJD9CKxPPa38LKmcaGdDki+1CzHcrbWQJCm7YAIttCXJdSNSU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=VCubSv7w; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VCubSv7w" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5238fe0cfc9so2472350e87.0 for ; Mon, 20 May 2024 05:12:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716207171; x=1716811971; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=M8rKQysuLyUxJHz0JlgckR0sJmCMpy02kHDsRfWeHc4=; b=VCubSv7wkD9lh1kHTBAaYmn3ftTN9xXL/vt4vPIU2BgGK3zyASU3MAFm2aDdsx6ZIX gyJSDKAG7yoU5jdKsqS2yfkDj8xKBeb7fUU9HozXYxcSJI31CtlsVcYAo24iJW5o99jS 7JyAFNmpNcVs5V0tIN35zKRwVy8BJi+D1Goe1RQQ/W0T/0Pl6qIuPxQWy200PzmeP48K Y9ndQQb7ZYTnNIgC15XP4qOqo5t1TqgAzYZSI68OMHHmeYWt9x0hpSvMdEt6pc+43KiJ 3AxmkgX8yy6uI6BMGiJepN873+fbpz/fvjv2OF9LDmKnNnUj1EDOFTbRZlqv8W9iNTHv CDPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716207171; x=1716811971; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=M8rKQysuLyUxJHz0JlgckR0sJmCMpy02kHDsRfWeHc4=; b=kF656VfcjrsIPSZyb0/wt2QfAK2u/FaFZYii4ClAMwJw5xyygZOXwvngWQgiJ5Ekdd cVRLTWifh95u5eQuJ6zGRXQzZJy7NM46og72MN7ufx6SEvJwvRqT76x2IUTEFjZovpxX bnMg0bHK0RJKcTpUL82L1YBS+Njk354GtYq0nyXvQlJ6iYCNG6R8FKYqbu+4jdgyOfYD 06cNr+CZjCE5QiKrvtnDNTxPWAlOEd0DcrcNQDiQh9PeOkLEhc9SY3AkichlDHK421kx UkXA0trGxBjGHG6CmfKZoy3Mql3jwqQTLJzFi2q0OLv9Sp3ZLSSr/6OEbSwfwL3ZCZWK AHQw== X-Gm-Message-State: AOJu0YwL1yttawlQ9xuBL3zF1dU7Zjb6LnA1xBVJti0Zoaqyk74CLSWp aekXeziYO9e9ALj59hp4qczvNBD9Fntx2Z4wGc9irRWyzEwYWY6KuaZMjTqAHbQ= X-Google-Smtp-Source: AGHT+IEM/5lq5VbrxVRGPP3AdsXOfhy3gr/csJTCN6F5pjX5h0TynyHAHhOnBhGhqp1xs6FUoZ7GUQ== X-Received: by 2002:ac2:514d:0:b0:51f:5f6d:3fba with SMTP id 2adb3069b0e04-52407cddc4amr1877945e87.27.1716207171391; Mon, 20 May 2024 05:12:51 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-521f35ad6c0sm4273682e87.30.2024.05.20.05.12.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 05:12:50 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 20 May 2024 15:12:48 +0300 Subject: [PATCH 6/7] drm/msm/dsi: parse vsync source from device tree Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240520-dpu-handle-te-signal-v1-6-f273b42a089c@linaro.org> References: <20240520-dpu-handle-te-signal-v1-0-f273b42a089c@linaro.org> In-Reply-To: <20240520-dpu-handle-te-signal-v1-0-f273b42a089c@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Krishna Manikandan Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, Dmitry Baryshkov X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3299; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=ZrM9buBF+7o6VFKWXROwO7MpIS2e3+tniUIcYb9S9j0=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ5q3ne28q6Hfv7c8rj08x85Nxo/r11EX3Z6/SY11z/L/R 2+84vurk9GYhYGRi0FWTJHFp6Blasym5LAPO6bWwwxiZQKZwsDFKQAX4WL/7xS82iIlxvv1T6cf XYuZVFeEqqfvfCe3vrsj/bzLtdUXTq2wMfrVtnvZk3OCOlZF3i5GH/d235rE8tzPSJTh2sRzJyt 1CiJk1ixNifbU/P1uTeVD3Z3had/ydmpND952fNkRoe7g9Nnvbol17Fud+WZxtlHVdoMDKxRuTn 9+KURuhka6lmHf7XeTI37aWrZH8N6NXPPbjmX7PQFtFoOzqRUPD/G6JezJ+quT3PHw78eQ6R8Ub zamxIVOfDHNoP+Curp4XT3P/53vdPw/hspvUHKNSGDTCWP+ntV334J5Te4WxXkcClw/TmQxWjNH qMb/vFV477ennjx/8haJoPqProWPP95QOi3CL5ay7VoJAA== X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Allow board's device tree to specify the vsync source (aka TE source). If the property is omitted, the display controller driver will use the default setting. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/dsi/dsi.h | 1 + drivers/gpu/drm/msm/dsi/dsi_host.c | 11 +++++++++++ drivers/gpu/drm/msm/dsi/dsi_manager.c | 5 +++++ drivers/gpu/drm/msm/msm_drv.h | 6 ++++++ 4 files changed, 23 insertions(+) diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h index afc290408ba4..87496db203d6 100644 --- a/drivers/gpu/drm/msm/dsi/dsi.h +++ b/drivers/gpu/drm/msm/dsi/dsi.h @@ -37,6 +37,7 @@ struct msm_dsi { struct mipi_dsi_host *host; struct msm_dsi_phy *phy; + const char *te_source; struct drm_bridge *next_bridge; diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index c4d72562c95a..c26ad0fed54d 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -1786,9 +1786,11 @@ static int dsi_populate_dsc_params(struct msm_dsi_host *msm_host, struct drm_dsc static int dsi_host_parse_dt(struct msm_dsi_host *msm_host) { + struct msm_dsi *msm_dsi = platform_get_drvdata(msm_host->pdev); struct device *dev = &msm_host->pdev->dev; struct device_node *np = dev->of_node; struct device_node *endpoint; + const char *te_source; int ret = 0; /* @@ -1811,6 +1813,15 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host) goto err; } + ret = of_property_read_string(endpoint, "qcom,te-source", &te_source); + if (ret && ret != -EINVAL) { + DRM_DEV_ERROR(dev, "%s: invalid TE source configuration %d\n", + __func__, ret); + goto err; + } + if (!ret) + msm_dsi->te_source = devm_kstrdup(dev, te_source, GFP_KERNEL); + if (of_property_read_bool(np, "syscon-sfpb")) { msm_host->sfpb = syscon_regmap_lookup_by_phandle(np, "syscon-sfpb"); diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c index 5b3f3068fd92..a210b7c9e5ca 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_manager.c +++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c @@ -603,3 +603,8 @@ bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi) { return IS_MASTER_DSI_LINK(msm_dsi->id); } + +const char *msm_dsi_get_te_source(struct msm_dsi *msm_dsi) +{ + return msm_dsi->te_source; +} diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index 912ebaa5df84..afd98dffea99 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -330,6 +330,7 @@ bool msm_dsi_is_bonded_dsi(struct msm_dsi *msm_dsi); bool msm_dsi_is_master_dsi(struct msm_dsi *msm_dsi); bool msm_dsi_wide_bus_enabled(struct msm_dsi *msm_dsi); struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_dsi); +const char *msm_dsi_get_te_source(struct msm_dsi *msm_dsi); #else static inline void __init msm_dsi_register(void) { @@ -367,6 +368,11 @@ static inline struct drm_dsc_config *msm_dsi_get_dsc_config(struct msm_dsi *msm_ { return NULL; } + +static inline const char *msm_dsi_get_te_source(struct msm_dsi *msm_dsi) +{ + return NULL; +} #endif #ifdef CONFIG_DRM_MSM_DP