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, };