From patchwork Wed Dec 15 16:09:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 524283 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp501210imb; Wed, 15 Dec 2021 08:09:19 -0800 (PST) X-Google-Smtp-Source: ABdhPJyVzBIvtJCoL1vOQxKbxrov5JDMsf3kfivwpv42DxW8W9qMC2+/KjEE8SgQ4ouhpQWbScjC X-Received: by 2002:a05:6a00:17a4:b0:49f:c0c0:3263 with SMTP id s36-20020a056a0017a400b0049fc0c03263mr9700893pfg.81.1639584559691; Wed, 15 Dec 2021 08:09:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639584559; cv=none; d=google.com; s=arc-20160816; b=zjaOs8dYE7UCY5/m6XfhK9oA8TuOZ2sHycglRXcUf3QDGLZpTv/WtTH8NjX4s+mYyN govgQFATFMUKF+2WEvkOTbbetfyFjs1Opk5cJIXzleJKfMBwoF8DkwYV5BwFBo28VLc5 OvU7nETlitaLQFYHReAHO5MNw431rHyiGF5/LPJ21vPCfKejht0degVww3od5B8zQs3L bBqJjyIuwOEdy85mk6WoI6JwqtVZr7AzCL9+2my1zc7E5VEdsrfEhIu+Rg+RXkeL5aBS 5q12cY0VxFFVvUCJZK4Yqs/SRHyPYF/wj0pvp1Y4CjhnuS41UI/BlHMr6AEI7AGK4VgN q5hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:to:from:dkim-signature :delivered-to; bh=KclpA+/0L/F7u9jRUKSOAZvZNDtVIlk59RARlc86ggs=; b=Js9IF5JZ5MYKjxXcrLTnE9se98w9Au69+ILHeMzvO8L0hZW3RGNmWHUI+qfsXgoFpA f8sJTlmGiSUuGrtuOpDJdVDWvlfQi2Pu6Nc3rHhQlTH+qNKRvg6r/wtM/ZZAc5vf026R cFgwxIMuYA5o1UqfR3wWp46Pr+jRrUUnUYfB1Mc1kAe/N8UFoLK/0ITWAoXZ3GZsB7CN eBfwjqwxNN002gNW2xSOorhoEk6bo7Ku9eUupQkTXlmZ/t7hSp8bBoWgkO69Kov9q48X 163cacYwhccYWt4I4CF908Pfr35FeYLFBfndGhA/tawe2MCbJDs1EqaWSadaw13aKahg Attw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BW2Qt9Ea; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id u3si2802341pfk.211.2021.12.15.08.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 08:09:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BW2Qt9Ea; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 15EBD10EE41; Wed, 15 Dec 2021 16:09:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A37E10EE41 for ; Wed, 15 Dec 2021 16:09:17 +0000 (UTC) Received: by mail-lj1-x236.google.com with SMTP id b19so32270109ljr.12 for ; Wed, 15 Dec 2021 08:09:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KclpA+/0L/F7u9jRUKSOAZvZNDtVIlk59RARlc86ggs=; b=BW2Qt9EaFJTiHZdC3nvN/PUwTUpy6oR/0JRu42C/dW2P6CLvRaQ8LMP4HMHHmJLuk+ p2PK7QpmjSv6EOQ4aDhdemXNuF47Ju7eN6qz+UIsw7jD14G/EST3fRXX9pVe+4sT/phl D2T9v2LwbqBp128aZo89UtQEFu3Rlt2uyzS4Ok5/ef9CzrpHcHIGFjHkdQoU2GetS6Ni ci3Y2NrukaRT73fvM81iUMphUlzP9B82buHfUtiP0RkzW+k575bk3vcAXDAZir709dO2 OF58XG8Ol6bCAfxFxZjRI+gK1m9grn84DJ/OsUD82Xzd/jCvroYnzcf6cWc0UwXmBXhz c8Uw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=KclpA+/0L/F7u9jRUKSOAZvZNDtVIlk59RARlc86ggs=; b=G2UjDiV/ERYFrNW5S0dZ1erj90goCYsDVi0s5fAdd75DDM7w9NQBdniSkwp+9wNC+x WjclAquF82GroaK1pI0aWJd1O41hcBrcirA/2u1NmtB3T3z5gwQ2RhLk48G8AU6J5lKN poE7EEfRhJjw/IKiNFeSbkmBzE39FUzpF4kKlx05krHIjeZsStCcSunbnNXmXlX8eoA2 gPCWf/uoGqlK7ZhrOutMLpI7SMhQq4t0ttM1+WK1ZkEpqdGTx2NBva1fG7FGdQYEJvRO lJbyt9EiPPszw76e+LYzalXNKWk1PtcOODiS1IookaOSRr+0CdYQYXxlxIReWiWanOXQ kGSQ== X-Gm-Message-State: AOAM532S63PrcFzKMqo56F/qyxueWeQH9TS+Rkn6IpbgpyS+MOY1NbJ8 IGHkxzuxPsgWK8ekO9mr4LRpgA== X-Received: by 2002:a2e:964a:: with SMTP id z10mr10593692ljh.210.1639584555501; Wed, 15 Dec 2021 08:09:15 -0800 (PST) Received: from eriador.lan ([2001:470:dd84:abc0::8a5]) by smtp.gmail.com with ESMTPSA id p3sm384429lfo.162.2021.12.15.08.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 08:09:13 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 1/2] drm/msm/dpu: add dpu_crtc_atomic_print_state Date: Wed, 15 Dec 2021 19:09:11 +0300 Message-Id: <20211215160912.2715956-1-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Implement CRTC's atomic_print_state() callback, printing DPU-specific CRTC state (LM, CTL and DSPP ids). Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 59b1bcfbe8c0..df128a680697 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -924,6 +924,20 @@ static struct drm_crtc_state *dpu_crtc_duplicate_state(struct drm_crtc *crtc) return &cstate->base; } +static void dpu_crtc_atomic_print_state(struct drm_printer *p, + const struct drm_crtc_state *state) +{ + struct dpu_crtc_state *cstate = to_dpu_crtc_state(state); + int i; + + for (i = 0; i < cstate->num_mixers; i++) { + drm_printf(p, "\tlm[%d]=%d\n", i, cstate->mixers[i].hw_lm->idx - LM_0); + drm_printf(p, "\tctl[%d]=%d\n", i, cstate->mixers[i].lm_ctl->idx - CTL_0); + if (cstate->mixers[i].hw_dspp) + drm_printf(p, "\tdspp[%d]=%d\n", i, cstate->mixers[i].hw_dspp->idx - DSPP_0); + } +} + static void dpu_crtc_disable(struct drm_crtc *crtc, struct drm_atomic_state *state) { @@ -1454,6 +1468,7 @@ static const struct drm_crtc_funcs dpu_crtc_funcs = { .reset = dpu_crtc_reset, .atomic_duplicate_state = dpu_crtc_duplicate_state, .atomic_destroy_state = dpu_crtc_destroy_state, + .atomic_print_state = dpu_crtc_atomic_print_state, .late_register = dpu_crtc_late_register, .verify_crc_source = dpu_crtc_verify_crc_source, .set_crc_source = dpu_crtc_set_crc_source, From patchwork Wed Dec 15 16:09:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 524284 Delivered-To: patch@linaro.org Received: by 2002:a05:6e04:2287:0:0:0:0 with SMTP id bl7csp501284imb; Wed, 15 Dec 2021 08:09:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyhysQXUGxQHyD4WOvkGzFsf5FHV8MNpqPl0r2fMVOgKeYo5ENrigUQYCadn/2SVtAC0rT6 X-Received: by 2002:a17:90b:1b4d:: with SMTP id nv13mr511092pjb.234.1639584563230; Wed, 15 Dec 2021 08:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639584563; cv=none; d=google.com; s=arc-20160816; b=rR1h6Zetgbk7sTRFbw7vHgkvn10enlnHoDVnoRChFHiIsMSnnWE2uL+4Za5uTXS2UY eKGpX07S2bLAFeudbRnmKlOximZShPbo5E85IDHnjYXp7ZPFHVXH17kM03H115usy2lB yYsYCrvMe8yOGweRPNMD0xdJ7eNbEifhKhjFnETZXs2EWDa7zApNYJG2B8en7q7Dgyem 9lkB83uhdqtuMh+cmypcr+/L+WyNvbEMRgrMLeCGzJQnLjLMDGIzsNn25KyyvZsVpjnA wCdhjziLmNuAbjvObrqp5nsKkslB7rQEZG+kfb1O7Hlsdp9v8HEBasgmAUGspV0oCcds PCdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=QdlZYDEg2Npa2/UOZIIxAI9S4NIeOJrywA2dsCR6BOI=; b=cNGocdccSi4/soAn/JmsSqyzXda3rpEu5K7GxlSYeoq4SHcvLlSfGACIojcECro/Qr R9PTevlrrE63xIDxFgKoO6LtvzWiGNY7MtPbtalhZ2NBNVQ10/tretTegIkjEhHxtLUc XXl3pIXVYwWsIY5dvxkGDlqLz/hirAypGJzHczseas4yOehRFQcTCE8FChE8L850u2ON RzgMloyn/axwFbtSl4AzG1tjZfz+Rd+kQfFHFBWtI+XKrsTKTxw8vwEm+9+xt6Fwi5zh UvVB1fcNPedOB22PXPWa69MwpFUzSBmhjIhfrRfeaeAg/aNoqRpikzpbhr5ToCxwvQt5 fxDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=z3fLO+k3; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id 2si2234958pgb.725.2021.12.15.08.09.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 08:09:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=z3fLO+k3; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AA35210EE46; Wed, 15 Dec 2021 16:09:21 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABB1810EE44 for ; Wed, 15 Dec 2021 16:09:19 +0000 (UTC) Received: by mail-lj1-x232.google.com with SMTP id p8so34100006ljo.5 for ; Wed, 15 Dec 2021 08:09:19 -0800 (PST) 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 :mime-version:content-transfer-encoding; bh=QdlZYDEg2Npa2/UOZIIxAI9S4NIeOJrywA2dsCR6BOI=; b=z3fLO+k3D0KXKxgHVZ/qrpAwc/J/XXxxg+KWwgi1W2ARobrtO6/lZmbwxHcAVc5UF/ MbvvXZWUSAzT5FXrlxUNBR2KGQ5fbmWw4JckHPYxqnyR10NSoXdfOX7mpC1RVjBsdspJ qzse8CCQjFytx+KpIroNnru2jv2KtinxjNMkpb6AYVriYFZ1Ovj8CKozzcKo5c2BtHwB MQqcUzCYkPyx6yni2SifrXydTSrvbaiH8HUCBSXgtB/xUZ3yoVTRbI6mWjOOqLad3ZYg p8YpzeKLnELSXkNvNsevwGKgWoWVvszDl3w1ZIxQsJww3lTNX0HWCKpouaS6alVKh4m3 WcMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QdlZYDEg2Npa2/UOZIIxAI9S4NIeOJrywA2dsCR6BOI=; b=CzGyxDWUfsUqt4Qsr/hWCMXPHPFREUK6bHHND6yzSEVvcxNVKHE5OT+eS8X41TZvKu /nq+z8PWNg266jeL3n6gwAstXqT09ZR1r9Yze7NugED4v7hogKahaCgI1yF3Q5OGZcYN zr7G9WCqOceC3SHxRNw1z4hu1Wi0jEDyAH4ZelxREtie5PdqnsFB2WAPvhKkKlHtbLkA PR7UKwXFjZ3jvg/kVmqNJvLsphBnVtp/W7HmkV/UJJo1F4j5dHxAMpkEtCwMloGpdKvW 3s7dMzHEJfoXj9PJ4Xou9d9COx9Qx3TlP55gTE7TacZRfD3Pc9Hn5Az68b01L63FbTBt seSg== X-Gm-Message-State: AOAM531BxcYsYWrHNKg645TTnfd8e4PKcF1uc+UebYh32t/sGNQDBp9V Dc4QNjLo3ZQUFV0delC+aQXdjQ== X-Received: by 2002:a2e:7216:: with SMTP id n22mr10870580ljc.44.1639584557936; Wed, 15 Dec 2021 08:09:17 -0800 (PST) Received: from eriador.lan ([2001:470:dd84:abc0::8a5]) by smtp.gmail.com with ESMTPSA id p3sm384429lfo.162.2021.12.15.08.09.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Dec 2021 08:09:16 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 2/2] drm/msm/dpu: add dpu_plane_atomic_print_state Date: Wed, 15 Dec 2021 19:09:12 +0300 Message-Id: <20211215160912.2715956-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211215160912.2715956-1-dmitry.baryshkov@linaro.org> References: <20211215160912.2715956-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Stephen Boyd , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Implement plane's atomic_print_state() callback, printing DPU-specific plane state: blending stage, SSPP and multirect mode and index. Signed-off-by: Dmitry Baryshkov Reviewed-by: Stephen Boyd Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index fe2f8221ab6e..bdecbe39a12b 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -1305,6 +1305,46 @@ dpu_plane_duplicate_state(struct drm_plane *plane) return &pstate->base; } +static const char * const multirect_mode_name[] = { + [DPU_SSPP_MULTIRECT_NONE] = "none", + [DPU_SSPP_MULTIRECT_PARALLEL] = "parallel", + [DPU_SSPP_MULTIRECT_TIME_MX] = "time_mx", +}; + +static const char * const multirect_index_name[] = { + [DPU_SSPP_RECT_SOLO] = "solo", + [DPU_SSPP_RECT_0] = "rect_0", + [DPU_SSPP_RECT_1] = "rect_1", +}; + +static const char *dpu_get_multirect_mode(enum dpu_sspp_multirect_mode mode) +{ + if (WARN_ON(mode >= ARRAY_SIZE(multirect_mode_name))) + return "unknown"; + + return multirect_mode_name[mode]; +} + +static const char *dpu_get_multirect_index(enum dpu_sspp_multirect_index index) +{ + if (WARN_ON(index >= ARRAY_SIZE(multirect_index_name))) + return "unknown"; + + return multirect_index_name[index]; +} + +static void dpu_plane_atomic_print_state(struct drm_printer *p, + const struct drm_plane_state *state) +{ + struct dpu_plane_state *pstate = to_dpu_plane_state(state); + struct dpu_plane *pdpu = to_dpu_plane(state->plane); + + drm_printf(p, "\tstage=%d\n", pstate->stage); + drm_printf(p, "\tsspp=%s\n", pdpu->pipe_hw->cap->name); + drm_printf(p, "\tmultirect_mode=%s\n", dpu_get_multirect_mode(pstate->multirect_mode)); + drm_printf(p, "\tmultirect_index=%s\n", dpu_get_multirect_index(pstate->multirect_index)); +} + static void dpu_plane_reset(struct drm_plane *plane) { struct dpu_plane *pdpu; @@ -1388,6 +1428,7 @@ static const struct drm_plane_funcs dpu_plane_funcs = { .reset = dpu_plane_reset, .atomic_duplicate_state = dpu_plane_duplicate_state, .atomic_destroy_state = dpu_plane_destroy_state, + .atomic_print_state = dpu_plane_atomic_print_state, .format_mod_supported = dpu_plane_format_mod_supported, };