From patchwork Thu Feb 3 08:26:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539584 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2222973imr; Thu, 3 Feb 2022 00:26:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXr7YvdYLI4h5TbRChKgvdtYlSIEQimktgo7/3dt6HSbY1b5qU84VSdFE5mVvl9eS3nUsm X-Received: by 2002:a17:902:9a06:: with SMTP id v6mr17361122plp.109.1643876781173; Thu, 03 Feb 2022 00:26:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876781; cv=none; d=google.com; s=arc-20160816; b=PmHL9E4fYb84nTUzjKUTDpkSnieWu53r4Mp7TrDhZoS+0humjMeZbcnidZWTIuRvK/ hXROpLNrjGg2A7Jw/T6Njnr+8AYPUWNg4TqBTloRpBXYetvbNzT922cpyahbkWl64R4x h4h9rw4UfBM0xMh0yajdl4/yBHJ38v0oSH5IlRorNJgHIXo/WYSFNK3JK8P4Phg5okbC z7Triu0BX59rK9aMIe4OTeWidjb6TB4iGTX0b2K++mRnwPLoTvERa2MXVKVvoArlaKRy wUAY6doqoYxaxxYQxmlNKtEDFB8qbxttMgr7t7fCArRlIbPJg1SnEM8oe+HS4BZ97hAt o/rw== 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=sfwEed+GJAr0KDwg+GYGg8QDt2lqdwbQp3DHVhIOZQQ=; b=SFqrd9gIBlGBLwXgqv5P/Oc3tL0z6ociN4fhdbnTQl6+j9AFvQrgEWPG5WgQcC+2Nh oO2FmEz4/8DRbet2VH2MieaLMwIHSirxo/V/h3GVO21X21nS+K/AntYGs2Weih+KX1rY fY8MByYYRq9QQaVU1cBDnnwV9Pd1eBrmA19lvguT+9g1KrMk3OikJ5Lqy3aMNfylpOqz ozeUs5Lr5wWHS9hcPgjlhdGS+NUPxFZ0A5bAaTB7uwwCNlqmb9Lk5vU20stce7CoYkAr bv9Ze38XXRjY7ZNCP5/dAm6+NkgpoBx8P1whcBtTdkkOZcDwSWvpMzm1Et4LJIhrgI3+ jlLw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XWqsNZ+t; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id nu18si7232082pjb.172.2022.02.03.00.26.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=XWqsNZ+t; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 8305110EBE1; Thu, 3 Feb 2022 08:26:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22d.google.com (mail-lj1-x22d.google.com [IPv6:2a00:1450:4864:20::22d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0BD2310EA09 for ; Thu, 3 Feb 2022 08:26:16 +0000 (UTC) Received: by mail-lj1-x22d.google.com with SMTP id t7so2749034ljc.10 for ; Thu, 03 Feb 2022 00:26:15 -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=sfwEed+GJAr0KDwg+GYGg8QDt2lqdwbQp3DHVhIOZQQ=; b=XWqsNZ+t9i/U4p0KeuaSH72S02HQnwRce+TrI4VLyzbPGmSz+xtnMCgvt7GWHlx849 jzuBkm2V9/KqHaSslcs/kXqxP6337cc6sxkNhvlG/7zfWxDCRs+P472qPS3vqwpcZjx9 Fg1MZhCtPUEYhnMSk8ECZHfxJRce3RAGlVJsjIpsJu1ESC+Ub8h3hYjEdYpXDpDAL8Gv 3uJOiQl5p+MQTcVOhHCQZKnGYThT1GtkDqkIA5ORNcaXcuPPlkMNX7OZdsY22Y5mLoSa HN6oGINDBCQVEL2S/Q0oj9l5kabL97lb0NDM+p0EgymBC2lAJBAYLZKEo4jvwe2eSEPz Zaxw== 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=sfwEed+GJAr0KDwg+GYGg8QDt2lqdwbQp3DHVhIOZQQ=; b=N3EAslgfcQE2y7tQPlPlYQ6BNoNS3AYeyv8+OnTDyIyCPuEt103O6GT0R5xVoCgJui 4W6Q2fleNB8w1WDviPe5ZGrHBtSlV4Scpi5xL2aT7LtlESlTEwA8TQ64pn72x6HLSIUU gDvdT6AF4REgO9RHj51pkk6oNNTbyQny9+xHlDQX6CzvDpun6qMEO/8zObiEtCtDtPwt PzCkZ0sbjtcZNi8xlGrmISid7aXLzcrn9EJOJviVGtxOQwgyycNUzFuawKz3ZfWYzHtn WATFNP6SLqBPiG6MEbS3qW4Kwgn2lZ0Ef5timqOEcBEATKhcQHcWm8cXzp9yaVAwhRWY anNw== X-Gm-Message-State: AOAM530wJx4R6/Y25/5r0NSs34XGY5WYDKQBjatC/iGh21o845BVAjdP DBALKH+ViwvobMqa8bSLFcIv0g== X-Received: by 2002:a2e:988d:: with SMTP id b13mr18964703ljj.170.1643876774158; Thu, 03 Feb 2022 00:26:14 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:13 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 1/7] drm/msm: move struct msm_display_info to dpu driver Date: Thu, 3 Feb 2022 11:26:05 +0300 Message-Id: <20220203082611.2654810-2-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" The msm_display_info structure is not used by the rest of msm driver, so move it into the dpu1 (dpu_encoder.h to be precise). Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 18 ++++++++++++++++++ drivers/gpu/drm/msm/msm_drv.h | 18 ------------------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h index e241914a9677..ebe3944355bb 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h @@ -34,6 +34,24 @@ struct dpu_encoder_hw_resources { void dpu_encoder_get_hw_resources(struct drm_encoder *encoder, struct dpu_encoder_hw_resources *hw_res); +/** + * struct msm_display_info - defines display properties + * @intf_type: DRM_MODE_ENCODER_ type + * @capabilities: Bitmask of display flags + * @num_of_h_tiles: Number of horizontal tiles in case of split interface + * @h_tile_instance: Controller instance used per tile. Number of elements is + * based on num_of_h_tiles + * @is_te_using_watchdog_timer: Boolean to indicate watchdog TE is + * used instead of panel TE in cmd mode panels + */ +struct msm_display_info { + int intf_type; + uint32_t capabilities; + uint32_t num_of_h_tiles; + uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY]; + bool is_te_using_watchdog_timer; +}; + /** * dpu_encoder_assign_crtc - Link the encoder to the crtc it's assigned to * @encoder: encoder pointer diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index d7574e6bd4e4..16f9e25ee19e 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -109,24 +109,6 @@ struct msm_display_topology { u32 num_dspp; }; -/** - * struct msm_display_info - defines display properties - * @intf_type: DRM_MODE_ENCODER_ type - * @capabilities: Bitmask of display flags - * @num_of_h_tiles: Number of horizontal tiles in case of split interface - * @h_tile_instance: Controller instance used per tile. Number of elements is - * based on num_of_h_tiles - * @is_te_using_watchdog_timer: Boolean to indicate watchdog TE is - * used instead of panel TE in cmd mode panels - */ -struct msm_display_info { - int intf_type; - uint32_t capabilities; - uint32_t num_of_h_tiles; - uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY]; - bool is_te_using_watchdog_timer; -}; - /* Commit/Event thread specific structure */ struct msm_drm_thread { struct drm_device *dev; From patchwork Thu Feb 3 08:26:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539586 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2223003imr; Thu, 3 Feb 2022 00:26:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzI/1j1Ng7KPpKoYKh7hIoTT967nwbX8zAwybpcBlSskAFXsllL/39l8U23nvJ3LEhLxNxe X-Received: by 2002:a17:90a:9908:: with SMTP id b8mr12420519pjp.125.1643876785852; Thu, 03 Feb 2022 00:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876785; cv=none; d=google.com; s=arc-20160816; b=qv22JqcP2IM8SvENrMk3HYj9cZ1p71t/KsC0WVRLHD9zUtSWY2sA+9Db9uWeFbC4tz ZVQRUuiPaPPnSFFSU3yyRFEg3vPt53LRmg4lJcCx068KkjFhoZe391ctnHpR4Lfx2cs+ aKWlR60kFCspuoBYOCZdL4qlK6AKFEixB5QNB8lAzFjRDk/LHu1Mu1XTWgfGFZHDHU8u 8dQCBByhPAkuzibGjKdSrMkeGqjUJrhEU6ZyulSB2GxSQVEFlsN5k0Wi9wsH9NCHjB8Y LFEs63dUZrnRo2bpP8YlWEW0vSD5aufqNYQhKQbkHVWFQktDSMLIN6dKX1HQEAIE2NJ9 WQbQ== 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=+wSU34yraQ2ZRR8Er/D8D7vbjQgPnuIKReJWue9YfHY=; b=IIurUZx9nu1gybvj22heaaafyiZiWlyXlaJoitaM7GnHL2obwbqfXVOBowB1ojT4s9 XG3igHJsGCYVM7+ju4yR2aWjwf10k7nyfKOg130j4fV0Y8JtDEhCBmJSOTCQQFgA03nG 94+eMkXtvFfDIYfiVMS/YuwkKCCp/mqxtSB+/K0ge5owtvGogmqLBSuQ7N4DQRywgKB3 WXl9akqng9lVXJA0fg14RWZXkkr8IUaeYV4HZtNUX1NdlRjeXjtsNqWJ6+tE3iylIVUI Wu6LrnWJAa6zloiBfhDoPSd12FuD/Fqrdvj8m6m3qNTaa7ndf3huBLqv0WtJOJmsIqrE GJJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=CQ0U8lKx; 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 l13si5826088pgj.292.2022.02.03.00.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:25 -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=CQ0U8lKx; 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 8AEF210EBE0; Thu, 3 Feb 2022 08:26:18 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22f.google.com (mail-lj1-x22f.google.com [IPv6:2a00:1450:4864:20::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id B030C10EBC3 for ; Thu, 3 Feb 2022 08:26:16 +0000 (UTC) Received: by mail-lj1-x22f.google.com with SMTP id j14so2802288lja.3 for ; Thu, 03 Feb 2022 00:26:16 -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=+wSU34yraQ2ZRR8Er/D8D7vbjQgPnuIKReJWue9YfHY=; b=CQ0U8lKxjH+YkU6Gnm+dNpAkAshCvyFDbKS4lBSveqTyjfUKsfZLnoW7smfSFdS91I uSWTVCAJsIbLOqJKThsrJrU1Sid+FsD9sjZ4ELg/BfHBBR6OFr1PdagdhgLXGOGJEXh7 ZBjRTovS6CICayZ4TzLwUeBAiblg2zzL2PQ30/yZvgu3vZCrB8lw29G25TD+a7EIVIaz CWo5kQBG+p2NwmU8R3yQZdDHtERpcQSz5mxmYaL93Jw96cDGGOZ9HpTVJWmS8zUyN5FK oZn0b7tSak7olXckVTeLIJH8pA5tLNWlIBt7Ib4gK7dn+KUbCKRSFUVYdy9dUy3nHhSX IjPA== 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=+wSU34yraQ2ZRR8Er/D8D7vbjQgPnuIKReJWue9YfHY=; b=VPWCAipWPUsZ+hKh26E8iiRF6pXFF0qelcmhnPVlL06tH7BqqgN9uFqIEDSaztia5K 3VUPP3lH2m5YTa8ZnQI5Y/GBqyVDHvD4T/uvjrZTn/UHUCkD0+BOnvgNdU0nOFdrMu+M H+zT+Hn6LSk9dpKCgsaMe/GGB99TfV6hECYVQGUZd8n2vY5v9MQOxZ05ocMsEaG9Q26y Bbs/DFLTW1OqWvPxcwhUif6ls49QzlxreMyBGhDt8O32WkSdgd7nzX0BY8sCLjpEL67I fTOKE+X+i/7ac498sSDjgM5Em8I9ltxjKdMrU2VFb6jxbZra+CDr/L//aIeIhnTAsmCH +6+g== X-Gm-Message-State: AOAM531cVakeecugjN2GNhqOPRub64Xzg1oiLg8j8TNL3w37WOjGb+gE 2XDCwnA9409DAn6rzWXhPDN0iw== X-Received: by 2002:a2e:b8d6:: with SMTP id s22mr22758251ljp.218.1643876774942; Thu, 03 Feb 2022 00:26:14 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:14 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 2/7] drm/msm/dpu: simplify intf allocation code Date: Thu, 3 Feb 2022 11:26:06 +0300 Message-Id: <20220203082611.2654810-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" Rather than passing DRM_MODE_ENCODER_* and letting dpu_encoder to guess, which intf type we mean, pass INTF_DSI/INTF_DP directly. While we are at it, fix the DP audio enablement code which was comparing intf_type, DRM_MODE_ENCODER_TMDS (= 2) with DRM_MODE_CONNECTOR_DisplayPort (= 10). Which would never succeed. Fixes: d13e36d7d222 ("drm/msm/dp: add audio support for Display Port on MSM") Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 28 +++++++-------------- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 4 +-- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 4 +-- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 1e648db439f9..e8fc029ad607 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -493,7 +493,7 @@ void dpu_encoder_helper_split_config( hw_mdptop = phys_enc->hw_mdptop; disp_info = &dpu_enc->disp_info; - if (disp_info->intf_type != DRM_MODE_ENCODER_DSI) + if (disp_info->intf_type != INTF_DSI) return; /** @@ -555,7 +555,7 @@ static struct msm_display_topology dpu_encoder_get_topology( else topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1; - if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) { + if (dpu_enc->disp_info.intf_type == INTF_DSI) { if (dpu_kms->catalog->dspp && (dpu_kms->catalog->dspp_count >= topology.num_lm)) topology.num_dspp = topology.num_lm; @@ -1099,7 +1099,7 @@ static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc) } - if (dpu_enc->disp_info.intf_type == DRM_MODE_CONNECTOR_DisplayPort && + if (dpu_enc->disp_info.intf_type == INTF_DP && dpu_enc->cur_master->hw_mdptop && dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select) dpu_enc->cur_master->hw_mdptop->ops.intf_audio_select( @@ -1107,7 +1107,7 @@ static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc) _dpu_encoder_update_vsync_source(dpu_enc, &dpu_enc->disp_info); - if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI && + if (dpu_enc->disp_info.intf_type == INTF_DSI && !WARN_ON(dpu_enc->num_phys_encs == 0)) { unsigned bpc = dpu_enc->phys_encs[0]->connector->display_info.bpc; for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) { @@ -1981,7 +1981,6 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, { int ret = 0; int i = 0; - enum dpu_intf_type intf_type = INTF_NONE; struct dpu_enc_phys_init_params phys_params; if (!dpu_enc) { @@ -1997,15 +1996,6 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, phys_params.parent_ops = &dpu_encoder_parent_ops; phys_params.enc_spinlock = &dpu_enc->enc_spinlock; - switch (disp_info->intf_type) { - case DRM_MODE_ENCODER_DSI: - intf_type = INTF_DSI; - break; - case DRM_MODE_ENCODER_TMDS: - intf_type = INTF_DP; - break; - } - WARN_ON(disp_info->num_of_h_tiles < 1); DPU_DEBUG("dsi_info->num_of_h_tiles %d\n", disp_info->num_of_h_tiles); @@ -2037,11 +2027,11 @@ static int dpu_encoder_setup_display(struct dpu_encoder_virt *dpu_enc, i, controller_id, phys_params.split_role); phys_params.intf_idx = dpu_encoder_get_intf(dpu_kms->catalog, - intf_type, - controller_id); + disp_info->intf_type, + controller_id); if (phys_params.intf_idx == INTF_MAX) { DPU_ERROR_ENC(dpu_enc, "could not get intf: type %d, id %d\n", - intf_type, controller_id); + disp_info->intf_type, controller_id); ret = -EINVAL; } @@ -2124,11 +2114,11 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, timer_setup(&dpu_enc->frame_done_timer, dpu_encoder_frame_done_timeout, 0); - if (disp_info->intf_type == DRM_MODE_ENCODER_DSI) + if (disp_info->intf_type == INTF_DSI) timer_setup(&dpu_enc->vsync_event_timer, dpu_encoder_vsync_event_handler, 0); - else if (disp_info->intf_type == DRM_MODE_ENCODER_TMDS) + else if (disp_info->intf_type == INTF_DP || disp_info->intf_type == INTF_EDP) dpu_enc->dp = priv->dp[disp_info->h_tile_instance[0]]; INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h index ebe3944355bb..3891bcbbe5a4 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h @@ -36,7 +36,7 @@ void dpu_encoder_get_hw_resources(struct drm_encoder *encoder, /** * struct msm_display_info - defines display properties - * @intf_type: DRM_MODE_ENCODER_ type + * @intf_type: INTF_ type * @capabilities: Bitmask of display flags * @num_of_h_tiles: Number of horizontal tiles in case of split interface * @h_tile_instance: Controller instance used per tile. Number of elements is @@ -45,7 +45,7 @@ void dpu_encoder_get_hw_resources(struct drm_encoder *encoder, * used instead of panel TE in cmd mode panels */ struct msm_display_info { - int intf_type; + enum dpu_intf_type intf_type; uint32_t capabilities; uint32_t num_of_h_tiles; uint32_t h_tile_instance[MAX_H_TILES_PER_DISPLAY]; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 47fe11a84a77..f4028be9e2e2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -564,7 +564,7 @@ static int _dpu_kms_initialize_dsi(struct drm_device *dev, priv->encoders[priv->num_encoders++] = encoder; memset(&info, 0, sizeof(info)); - info.intf_type = encoder->encoder_type; + info.intf_type = INTF_DSI; rc = msm_dsi_modeset_init(priv->dsi[i], dev, encoder); if (rc) { @@ -630,7 +630,7 @@ static int _dpu_kms_initialize_displayport(struct drm_device *dev, info.num_of_h_tiles = 1; info.h_tile_instance[0] = i; info.capabilities = MSM_DISPLAY_CAP_VID_MODE; - info.intf_type = encoder->encoder_type; + info.intf_type = INTF_DP; /* FIXME: support eDP too */ rc = dpu_encoder_setup(dev, encoder, &info); if (rc) { DPU_ERROR("failed to setup DPU encoder %d: rc:%d\n", From patchwork Thu Feb 3 08:26:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539585 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2222985imr; Thu, 3 Feb 2022 00:26:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzOwCw6/zTD+0bFwJSEMOlOZpBMgL0iSs2pU4qgsNBd4RwA4a6GQbx9Qmp49EOdRNUMUSV/ X-Received: by 2002:a17:902:e742:: with SMTP id p2mr34191513plf.130.1643876783477; Thu, 03 Feb 2022 00:26:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876783; cv=none; d=google.com; s=arc-20160816; b=W+7hhcT4O1eNxAHyL+kvZgAL0E49ZRSZEeQ1bZ++hHWtt7swCME5VDWhfih69rzB4S c+dFncN+YgyQkLF9nedt4fAPQ+3Z9Z/kAnlAAp4z6/yPxojo7lvgKw0UJaNdMEfYv3D4 ETQbseAmCv5cScSp2UvSf/bticZNf0jvUgQnDnYGB0zjYwChJgQQ+5GwE4PHQ/48ygNs RZ/YFkL3eo08HwT352rF491/n0KP1rgz07ug9HihAD279pH/Wabz5h2pie9ub3aexai7 SxUItyKYphbbIuvl/exqJgf0xqBfvbHW5vN/2Bu0u5gUiNBBxUIb9//xS3BP+UpaEuPZ z+Dg== 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=nyqAWn+MLtydxGLUl27Vc6FqSrdQWPLLY5cb0Wp4tL0=; b=snPxpSMhvmzntZaMKOW/spyucEttGXl2Dm2KM4FJvjGdMxqPwNv2zRxK6XnMT1rMtk gb/2tHbW2JdAWVQ9jtoL5xE4RDZtSqvKdI5GkdYOPXC4HM6v0ChaU3Ac/pqemSFWcyQ+ pW+ggD4RP60cjOQ7WXs3vgyB/VwTLbP3aE+Ad4//oAjhJkUkY4U++yfkIYP+8mlutl/7 Z04EPvAlYUzttmgVc0AhDa23MH57NEzbYxn8LlT8cO4Vi3guTB8tL5gncDCb7uY66J9D Suy0wKyy+q8n8LkXetgNJb214ymOgXy3tSTRnomMZraFxUzjSH6HY4rZHg3vC7GifG2n /RtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E40myW0D; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id 13si18992480pfo.120.2022.02.03.00.26.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=E40myW0D; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 55BE610EC15; Thu, 3 Feb 2022 08:26:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5440E10EBE0 for ; Thu, 3 Feb 2022 08:26:17 +0000 (UTC) Received: by mail-lf1-x129.google.com with SMTP id o12so4285619lfg.12 for ; Thu, 03 Feb 2022 00:26: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=nyqAWn+MLtydxGLUl27Vc6FqSrdQWPLLY5cb0Wp4tL0=; b=E40myW0Dt62WsHZYp64vJbBGaUyByvUm0+AbpUUH+1FNbwrKE+JPrwmJSEAHrRNxSi v24iUSxQOSxR1cWAM8nNtgrjVcbIFxlrkPDSVAxmgALwRjRJkvLgCa+Bzsy3RgHQp4HZ aZtr+KM4OtBYZ/u2uA34l1JGVWV3C1aNQnA+zElc5wTLWvxWdjoBZhd59lPNhMrI6wrb 1IkAJtJSUC/hRXqEoGx4ZK+U2F0UdamSRNBSlXLl2vlTxf63Iwuxrf3XLusmX/XZgz8T RE9n3Q8mHAMlSOFuTQhWcSpBNF6p5/KE6nMEBE8XhUYIxBt4x9n7Vk+NRQn8p1XzZ5HE m0xQ== 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=nyqAWn+MLtydxGLUl27Vc6FqSrdQWPLLY5cb0Wp4tL0=; b=n7YrZnmHpuF+b1/ZPhEDMv3n0BnTpXwASTunqPx4dihYqHFNH19QRxP6xZVp492BwJ XmFtPxtU6ygmpEVIVXiRlOZL0yOmn/ysWSKQ0RszLc1cMTcAzXA485o3pV+b4zpyJAfq HSXiCetCEuH2HZNlxvAN8dal/tu5pdGbRHpdNQISZuIodYY9e3LLIAIMcgN8qEjiCPBz CJiEEWNiMiVPdBoLkkNSyDFRNmW9AOBpmVRlQPaajsAMuhl9PAIhSRzx0wAIPiiLli8Z 278QvRLkIPxU7oGGhf0vGEF9DyuttoO2yiH7adQ4ocZvuuYMG9Vnn/KBpfW0OjwhZe2b 5i2g== X-Gm-Message-State: AOAM531qFcwehMKTjsV8s1HTVwj/BiHOADNwnUQEln7qIWCP/UGiF/8Z vD93QXU480WXFeYrmoph58CLGQ== X-Received: by 2002:ac2:55ad:: with SMTP id y13mr25702114lfg.38.1643876775631; Thu, 03 Feb 2022 00:26:15 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:15 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 3/7] drm/msm/dpu: remove msm_dp cached in dpu_encoder_virt Date: Thu, 3 Feb 2022 11:26:07 +0300 Message-Id: <20220203082611.2654810-4-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" Stop caching msm_dp instance in dpu_encoder_virt since it's not used now. Fixes: 8a3b4c17f863 ("drm/msm/dp: employ bridge mechanism for display enable and disable") Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index e8fc029ad607..6c1a19ffae38 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -168,7 +168,6 @@ enum dpu_enc_rc_states { * @vsync_event_work: worker to handle vsync event for autorefresh * @topology: topology of the display * @idle_timeout: idle timeout duration in milliseconds - * @dp: msm_dp pointer, for DP encoders */ struct dpu_encoder_virt { struct drm_encoder base; @@ -207,8 +206,6 @@ struct dpu_encoder_virt { struct msm_display_topology topology; u32 idle_timeout; - - struct msm_dp *dp; }; #define to_dpu_encoder_virt(x) container_of(x, struct dpu_encoder_virt, base) @@ -2118,8 +2115,6 @@ int dpu_encoder_setup(struct drm_device *dev, struct drm_encoder *enc, timer_setup(&dpu_enc->vsync_event_timer, dpu_encoder_vsync_event_handler, 0); - else if (disp_info->intf_type == INTF_DP || disp_info->intf_type == INTF_EDP) - dpu_enc->dp = priv->dp[disp_info->h_tile_instance[0]]; INIT_DELAYED_WORK(&dpu_enc->delayed_off_work, dpu_encoder_off_work); From patchwork Thu Feb 3 08:26:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539587 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2223022imr; Thu, 3 Feb 2022 00:26:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJxLND45agy3UtyngEGNNMyDGCmCy1s4JyAecLaGq5v5GkqOwZTcwO0hpeG0IKL3PCla/CIx X-Received: by 2002:aa7:8706:: with SMTP id b6mr33078282pfo.61.1643876787891; Thu, 03 Feb 2022 00:26:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876787; cv=none; d=google.com; s=arc-20160816; b=0TPh5aUYFF36fWSYxEdaelbofMAm1z+M/woIvgT6P+ybi8pMROOW07L7NekMuuy0SR nNA0nNPAStOWjw+KQOxMnIsYLOdIvYAl3pqKnneNhDS1+16l9jjs2GnqKEE8BmB/GWMd l3rt+wv5ba0JR/meCKrMGxhABu7SJoV6zjTCU6fC5cEQlbuJrzZ1doMkN/5zew3GkDVu MkGkvo+pqwrjz8AcBOB9GB3vRpmWyaFWrcKbmfdehrG1RBSmRVnMCAnDy7SZ+caBHX8F hTk4D0jcClKCIpm191incUW0d5rkesx8ezKHPHthv/P95ShbN5vQLQqpyQqKK1XAhVzn +VtQ== 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=8jvPULXIIzR0qzqGPTTUmR7uSAA4jIsRkWAFzhKA5wM=; b=hJMwVINVCjB6kpmTtnGdxFYN9QTXL6E18hXcxsOjd2u73GktPQ8dfuWD8ah5VBaWgy yxMgcihdNNOeKiIMQjCyShPZDdrFbhD78DLc/HspTmWg3pFdwIZOGWryk1bBLhpg5NYK Khpwo/tle/p6xdZ0qfptj5+PdroLMl/7X/0yhX6fiqSP65UJ4RRRzzdKcGzmp/QMjmJz g/QoFagN0nmwfHXlMlvRUMXv+ozGScd/p1UMOHGYEXpQXob94sNbC8NoqjBLxRCcUGRb MPaZwIenO4P8pq0vufOVneq05MEkK2SOSdupzwSzDO2TqVAs2m/9mXm0OXl+rfA8D+xY 3s7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="tN0CX3/x"; 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 r74si5590005pgr.435.2022.02.03.00.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:27 -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="tN0CX3/x"; 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 ABA4010EC3B; Thu, 3 Feb 2022 08:26:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [IPv6:2a00:1450:4864:20::135]) by gabe.freedesktop.org (Postfix) with ESMTPS id 203E910EBE3 for ; Thu, 3 Feb 2022 08:26:18 +0000 (UTC) Received: by mail-lf1-x135.google.com with SMTP id n8so4389984lfq.4 for ; Thu, 03 Feb 2022 00:26:18 -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=8jvPULXIIzR0qzqGPTTUmR7uSAA4jIsRkWAFzhKA5wM=; b=tN0CX3/x7KyOve+6YH7O2t+7rzfSwiG1JieGaG3cot3ESYYaTQPzOiBTSJcddDGrGu 6XXmb0J2mgAZP0KUWm0gmibjzp2sQtYdn56B5nzOVLlD0JawY9XHDp3+Tu1NVo7Qiwc7 g1Yt/9LvRaXH6LVUABbpiVhwWy8CVDf8hfYw7RQXmFJrzEQOX9ODxgIEIonVvZJeiZwN jbDXGHwCeyW31ec1X/fr43svDoj4/UweZP4f9ot3pWxNyMAcEnc19LPxC7l3q8h6k926 B20Zb1t4UzxgGFItkm5VtE5tDMvcAYTKHtR9KFrh8Q/Wsj8q3LyTLwXZ2hB7/YptARIK nDCg== 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=8jvPULXIIzR0qzqGPTTUmR7uSAA4jIsRkWAFzhKA5wM=; b=Wqk8k6AfIph81gkVM7d1hn17u/TZqGFzVtr/xCRjVQ9M1WCdXNwpOz68ncin+vvkmB rEG7hQs2GIzxGGiQyOpqItOMS6sZwhsCw4lpOwDCbb0ImpDwEqNt2WTcdO115a6mLrW6 /OeWhAUk6AdYdAgbXHKI1g8ew2NyEG7xZQ8RKW2olVTf3Y1H6uWOXhZ0yeQDdUG/jIVY owNKrJu8g8KaIwwyC9JDtaZiiw+M3BRbBKAJ6WWNYgZHkyvymASlhwLmug9L2tvB/uS0 /CpKuOnW3w7CVGrRNLaIJgnlZHYWO/dQ/hAndDQzi3jskSM1d4iRd+Ja+gvGPSD1i8Ei jRmA== X-Gm-Message-State: AOAM532U/GNReCIYczqNMdDKi9/ZOiFzdbwOr64D8Y3bqWh0VOcW0LOp YDKO5Tqud1GAEAxI59trE6Darg== X-Received: by 2002:a05:6512:1292:: with SMTP id u18mr25527911lfs.360.1643876776338; Thu, 03 Feb 2022 00:26:16 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:15 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 4/7] drm/msm/dpu: drop bus_scaling_client field Date: Thu, 3 Feb 2022 11:26:08 +0300 Message-Id: <20220203082611.2654810-5-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" We do not use MSM bus client, so drop bus_scaling_client field from dpu_encoder_virt. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 6c1a19ffae38..4530549850f0 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -127,7 +127,6 @@ enum dpu_enc_rc_states { * Virtual encoder registers itself with the DRM Framework as the encoder. * @base: drm_encoder base class for registration with DRM * @enc_spinlock: Virtual-Encoder-Wide Spin Lock for IRQ purposes - * @bus_scaling_client: Client handle to the bus scaling interface * @enabled: True if the encoder is active, protected by enc_lock * @num_phys_encs: Actual number of physical encoders contained. * @phys_encs: Container of physical encoders managed. @@ -172,7 +171,6 @@ enum dpu_enc_rc_states { struct dpu_encoder_virt { struct drm_encoder base; spinlock_t enc_spinlock; - uint32_t bus_scaling_client; bool enabled; From patchwork Thu Feb 3 08:26:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539588 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2223035imr; Thu, 3 Feb 2022 00:26:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMEzi4CrOy+/5AgDVLnkiE3U01QUq+AKtt2gveO4W+rWb7DriSufTALMTAgKPOJTYZqCLQ X-Received: by 2002:aa7:8490:: with SMTP id u16mr33175597pfn.1.1643876789746; Thu, 03 Feb 2022 00:26:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876789; cv=none; d=google.com; s=arc-20160816; b=Ce6c7Oi+2ZSwKMQLpVl55yw5ZJhHxGqHuZziuTllum08qHqg+GU7WtZb7utIEaE+5r 2BYZAAf4l3sv7O5ezXnF5buVrJ7IK9iMs++j+/k2IEo+Vzy0Sv2nuBjwWLr59zsK+vKY QBGyop69Ep5kDFfuyQHiBRO+04sV3yM38SqtRSVkd3bm3ugs40SnBaOjZXh0ANrrcORI joRYh0jlsb2Px8ucIguwnqcraZxFBQEJTe2ekgtv5m/sKXfzAC52uUha+9eWGbtJ5+pR OXHk6VZZArH3ch6KiRSwcrlDYQNpIjMCyLpUwA8WIU4nLcTomiU/rQYT1+iBvS19RKDV SnCw== 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=01vAlF56txli9i+1P79Ks55klOiBe1vcVce2eYfWMVQ=; b=jE01IqIQ5tV3NlkQd9DI6KO/VGvI0gNg85RoJ+Qad9NW+Xzjc6ax13cREStxqzZjmI XzgpDydR8l6tnzJUjnmgwT9DOC0OmR7His9CDEmpEdKkl3gPt+Eo57Ug1c5GiJUHywOa fM56pkKr+CgENCD22lIsZ0NElmDTr/bQ5wBLDQhAfP8HMxXpVt7ha0ZQ/R0uGhJqUzzS g2uFmK6GtGWuf/fPrFJwNtOVnvvKg+FAtK+CZsJINKZcqmdMculwik2r6vTuge/g9iNv i4qji8yeMAV6wUQVViL22atz8LjsNUNcmG7jasqvKEzBG7byGQ5y3GWM/akxTxeYK/Tk vjXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Wwc/jzjg"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id bm10si26143024pgb.28.2022.02.03.00.26.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="Wwc/jzjg"; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 5FEED10EC53; Thu, 3 Feb 2022 08:26:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id C778E10EBD4 for ; Thu, 3 Feb 2022 08:26:18 +0000 (UTC) Received: by mail-lj1-x233.google.com with SMTP id a25so2755512lji.9 for ; Thu, 03 Feb 2022 00:26:18 -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=01vAlF56txli9i+1P79Ks55klOiBe1vcVce2eYfWMVQ=; b=Wwc/jzjgCn8dBk34LwuCEYK7m8y/9uNjBKjS95Z8q5v6Y21BZUn6KR0FhGQoG/PKXc EsIwTQLDOQcobQw2eQt95hM4x1kEht2VWMCk2YoCebgreM9CBdiR4kvKTJgI4IoVqW9G yBEKL2LXHKmqu/KxzaGllFSPDZQk6RZVWHvW88XCI0chqDTxEwOYrmfnO/HXrJHyO456 p3oN5pgq41HdxkP2ITwqqwNHvHxyzxc4kZNBUhUsAQ2NBocpZzHvhlCgAeIuKuja6qDg hkz5N0LZG9XTP7yQP53PDM0KBB/CHPKiCCbbgEJuTjxZGBYApGVo4uYqPZAOlYrGCsVo uaVg== 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=01vAlF56txli9i+1P79Ks55klOiBe1vcVce2eYfWMVQ=; b=5cFqidsugO+4tArWIogo0SS/Lu/Nn+zkriad97yfiti1rU2gsQ/xLrdjGxL3FlaL8P 9QNn0c0c1egkVY3QsEUyr4tUinYkQuNWSsCPhKWlrRuFf2C4jrhe2y/ncRBR8jQ+5kIg 8MIrXNYMOezaibnzwGxTDr3otx+Ha81DwEpUR/+qwm831uW2leSsppX2o4g53VoaLcMz XMxIvUIPPHPVT/wkTls328r4y6r2ycmF7r42A30+M9uH/oGkCASopAW3qTac6tqW64ne XXfnZXQLDBNv624dYj8yGmevkOviCXguZhSkCXmT3/P4Zl8l7LyhW3GxSrkJRWxgl610 KWlg== X-Gm-Message-State: AOAM530toyjz/Yz/aK8COl1x3F575MUn1uqtmJE4YghdlXLneXd4smLR VSdxxutc4zMzWovzXQO8NwGG+A== X-Received: by 2002:a2e:96c6:: with SMTP id d6mr22096258ljj.215.1643876777023; Thu, 03 Feb 2022 00:26:17 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:16 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 5/7] drm/msm/dpu: encoder: drop unused callbacks Date: Thu, 3 Feb 2022 11:26:09 +0300 Message-Id: <20220203082611.2654810-6-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" Both cmd and vid backends provide no atomic_check() callbacks and useless mode_fixup() callbacks. Drop support for both of them. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 39 +++++-------------- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 8 ---- .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 10 ----- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 14 ------- 4 files changed, 9 insertions(+), 62 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 4530549850f0..e1c43a0c0643 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -573,7 +573,6 @@ static int dpu_encoder_virt_atomic_check( struct drm_display_mode *adj_mode; struct msm_display_topology topology; struct dpu_global_state *global_state; - int i = 0; int ret = 0; if (!drm_enc || !crtc_state || !conn_state) { @@ -595,39 +594,19 @@ static int dpu_encoder_virt_atomic_check( trace_dpu_enc_atomic_check(DRMID(drm_enc)); - /* perform atomic check on the first physical encoder (master) */ - for (i = 0; i < dpu_enc->num_phys_encs; i++) { - struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i]; - - if (phys->ops.atomic_check) - ret = phys->ops.atomic_check(phys, crtc_state, - conn_state); - else if (phys->ops.mode_fixup) - if (!phys->ops.mode_fixup(phys, mode, adj_mode)) - ret = -EINVAL; - - if (ret) { - DPU_ERROR_ENC(dpu_enc, - "mode unsupported, phys idx %d\n", i); - break; - } - } - topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode); /* Reserve dynamic resources now. */ - if (!ret) { - /* - * Release and Allocate resources on every modeset - * Dont allocate when active is false. - */ - if (drm_atomic_crtc_needs_modeset(crtc_state)) { - dpu_rm_release(global_state, drm_enc); + /* + * Release and Allocate resources on every modeset + * Dont allocate when active is false. + */ + if (drm_atomic_crtc_needs_modeset(crtc_state)) { + dpu_rm_release(global_state, drm_enc); - if (!crtc_state->active_changed || crtc_state->active) - ret = dpu_rm_reserve(&dpu_kms->rm, global_state, - drm_enc, crtc_state, topology); - } + if (!crtc_state->active_changed || crtc_state->active) + ret = dpu_rm_reserve(&dpu_kms->rm, global_state, + drm_enc, crtc_state, topology); } trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index e7270eb6b84b..159deb8ed7fb 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -84,12 +84,10 @@ struct dpu_encoder_virt_ops { * @is_master: Whether this phys_enc is the current master * encoder. Can be switched at enable time. Based * on split_role and current mode (CMD/VID). - * @mode_fixup: DRM Call. Fixup a DRM mode. * @mode_set: DRM Call. Set a DRM mode. * This likely caches the mode, for use at enable. * @enable: DRM Call. Enable a DRM mode. * @disable: DRM Call. Disable mode. - * @atomic_check: DRM Call. Atomic check new DRM state. * @destroy: DRM Call. Destroy and release resources. * @get_hw_resources: Populate the structure with the hardware * resources that this phys_enc is using. @@ -117,17 +115,11 @@ struct dpu_encoder_phys_ops { struct dentry *debugfs_root); void (*prepare_commit)(struct dpu_encoder_phys *encoder); bool (*is_master)(struct dpu_encoder_phys *encoder); - bool (*mode_fixup)(struct dpu_encoder_phys *encoder, - const struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode); void (*mode_set)(struct dpu_encoder_phys *encoder, struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode); void (*enable)(struct dpu_encoder_phys *encoder); void (*disable)(struct dpu_encoder_phys *encoder); - int (*atomic_check)(struct dpu_encoder_phys *encoder, - struct drm_crtc_state *crtc_state, - struct drm_connector_state *conn_state); void (*destroy)(struct dpu_encoder_phys *encoder); void (*get_hw_resources)(struct dpu_encoder_phys *encoder, struct dpu_encoder_hw_resources *hw_res); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index 34a6940d12c5..45fe97fb612d 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -45,15 +45,6 @@ static bool dpu_encoder_phys_cmd_is_master(struct dpu_encoder_phys *phys_enc) return (phys_enc->split_role != ENC_ROLE_SLAVE); } -static bool dpu_encoder_phys_cmd_mode_fixup( - struct dpu_encoder_phys *phys_enc, - const struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) -{ - DPU_DEBUG_CMDENC(to_dpu_encoder_phys_cmd(phys_enc), "\n"); - return true; -} - static void _dpu_encoder_phys_cmd_update_intf_cfg( struct dpu_encoder_phys *phys_enc) { @@ -732,7 +723,6 @@ static void dpu_encoder_phys_cmd_init_ops( ops->prepare_commit = dpu_encoder_phys_cmd_prepare_commit; ops->is_master = dpu_encoder_phys_cmd_is_master; ops->mode_set = dpu_encoder_phys_cmd_mode_set; - ops->mode_fixup = dpu_encoder_phys_cmd_mode_fixup; ops->enable = dpu_encoder_phys_cmd_enable; ops->disable = dpu_encoder_phys_cmd_disable; ops->destroy = dpu_encoder_phys_cmd_destroy; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index ddd9d89cd456..1831fe37c88c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -225,19 +225,6 @@ static void programmable_fetch_config(struct dpu_encoder_phys *phys_enc, spin_unlock_irqrestore(phys_enc->enc_spinlock, lock_flags); } -static bool dpu_encoder_phys_vid_mode_fixup( - struct dpu_encoder_phys *phys_enc, - const struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) -{ - DPU_DEBUG_VIDENC(phys_enc, "\n"); - - /* - * Modifying mode has consequences when the mode comes back to us - */ - return true; -} - static void dpu_encoder_phys_vid_setup_timing_engine( struct dpu_encoder_phys *phys_enc) { @@ -676,7 +663,6 @@ static void dpu_encoder_phys_vid_init_ops(struct dpu_encoder_phys_ops *ops) { ops->is_master = dpu_encoder_phys_vid_is_master; ops->mode_set = dpu_encoder_phys_vid_mode_set; - ops->mode_fixup = dpu_encoder_phys_vid_mode_fixup; ops->enable = dpu_encoder_phys_vid_enable; ops->disable = dpu_encoder_phys_vid_disable; ops->destroy = dpu_encoder_phys_vid_destroy; From patchwork Thu Feb 3 08:26:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539589 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2223042imr; Thu, 3 Feb 2022 00:26:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwgQIaPY7m+GzADThBEqw5YDG4Pn3Klqa6ocHw9y6XIA/MGJgz+/MnFgUdNKqOuT2donKq X-Received: by 2002:a17:902:8490:: with SMTP id c16mr34174746plo.129.1643876791023; Thu, 03 Feb 2022 00:26:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876791; cv=none; d=google.com; s=arc-20160816; b=XK+qAfvhiQVltGPpRGBxlney1ig6a7rWZkT++gmtPgvLQ7dXuhlYN+XRZSnmwFt2Rh z6lPwZqCas+0uZ+qpiRp46gjIObyLjFFZU8TvZ1OJMH3PxvMfTLmCj7nn/70z7uWHrci tJZrpxgrQbOOZ1RamjEVyh7zPejvECPFDIUwYr9wOVHw9ijwpg12PCvMdd46D7fbRQke n2iHUPy8+FlBBmiT6GI0STL7D350gLcFefrKpYz7v/dUdlu2hSYXRyEVxk7Eqv08V1SE MLKVp586pRtdxnDz/VwIO++gbOWMU6dEFSItNWv83XUJJvD5JbySqoUaczRE95seMFNE z4ig== 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=Kxx+KIsoHDhwboQa53vIY1pbo+Mq+g9OnoduNhwfSIo=; b=rXXaHW4AZleHZ65wNFDgdb9om1Vun8Jvd8TczfmX8rjayKZBxj9OEB3TOqsxjmPbdc 7BuKqcH+C9Aj1KzwCPuirdpYa8P8eSq8DulhWWpwG8UAcVvfIaxwtyJ7AVAly022Krb8 96jeDrU119Gm4ayeX/0opvvOI4hn67/W1W9DlC0DiSqGQPHP75YbNHYOTIPWdZVHDk98 5ioSMz6giIB0urbR1m8+ctRvSZGv4c6CyJnxkgxgLXx/HiYbCQjZEKlqfiPiB5uLYdqw J5DCsqveixFuv7caIBwWg5E1kir9gm5Btn+dymE7igiq2uyAe6TsF5HuNrAro26m2hye ShNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xYYyUP7c; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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. [131.252.210.177]) by mx.google.com with ESMTPS id 20si19126638pll.467.2022.02.03.00.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=xYYyUP7c; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 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 6906A10EC59; Thu, 3 Feb 2022 08:26:24 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lf1-x12f.google.com (mail-lf1-x12f.google.com [IPv6:2a00:1450:4864:20::12f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8CD0610EC1B for ; Thu, 3 Feb 2022 08:26:19 +0000 (UTC) Received: by mail-lf1-x12f.google.com with SMTP id o12so4285806lfg.12 for ; Thu, 03 Feb 2022 00:26: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=Kxx+KIsoHDhwboQa53vIY1pbo+Mq+g9OnoduNhwfSIo=; b=xYYyUP7csIEsiSPKFNcA1VEGne27p5LLKWa6gWf18Co1jtWThk7R1WLbVYLZZK6PHk o5EYCDDf5rmBDRbk+ISwmaPIWZUAZWeqlDsmXDXiFWcUBn/EeN+3pubgaTodzAyIKSEu 8PNC+ghgflkmaLBmoQrBlN+WEtf2SQ+8Fzztm1lp5xk0Z4o0fHbzc23aJ+Pb7rxs8htJ Rt5IVSDIZSCGArLGH/0me3d4xD8CNmCJHsM5FynYKv/mwrxB08Lu5f9sXm6hm/W5NvQH TncZGwnAvNd7n6jmhc0u8GdVVphoeoPY8r7RS5G5xCvhU3Emy0GrrpTx/k+6IIQKIi4I psQg== 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=Kxx+KIsoHDhwboQa53vIY1pbo+Mq+g9OnoduNhwfSIo=; b=ZRGBtUXyQJEmWxi/FJV2XIJ3LdWpMRUgqJeE2JRDVd5pU602DFtc3MExDB0ZGvoSX/ WYUQ/gCRy6ti75vtRXmvs3mMW6Z6uYevJG7Q2+DLwzfu81MMJZcYpc5KibOguQHDh/Nn aqOp6tY3kHNFr7WNB8r7MCmh7aRZWGr/M21Vfe4hmzt+6UoHuok2yvSCHEf1sFNATros uraPGLDqrjvio34d/p70pfUTli+pfSHR+3d5dHoSPJcqeViIimgs48S/sBVXWMl/p2+L joh9zJU/tHjI3a5y6WW7R0CxMUPbuXdaS4ex0ZCvRSRgiyS2+sXSnnYmKTNFZpDyEJNV /Dkg== X-Gm-Message-State: AOAM532idvY25hwsymB/dUHRC/FiMMu68SbJzhB2iMmDkcnBjWGJmp+L 69kjOirGOIPlssLQXiDEkKh7vQ== X-Received: by 2002:a05:6512:2316:: with SMTP id o22mr22064856lfu.244.1643876777798; Thu, 03 Feb 2022 00:26:17 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:17 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 6/7] drm/msm/dpu: switch dpu_encoder to use atomic_mode_set Date: Thu, 3 Feb 2022 11:26:10 +0300 Message-Id: <20220203082611.2654810-7-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" Make dpu_encoder use atomic_mode_set to receive connector and CRTC states as arguments rather than finding connector and CRTC by manually looping through the respective lists. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 37 +++++-------------- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 8 ++-- .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 18 ++------- .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 14 ++----- 4 files changed, 21 insertions(+), 56 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index e1c43a0c0643..1462c426c14c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -930,16 +930,13 @@ static int dpu_encoder_resource_control(struct drm_encoder *drm_enc, return 0; } -static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) +static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { struct dpu_encoder_virt *dpu_enc; struct msm_drm_private *priv; struct dpu_kms *dpu_kms; - struct list_head *connector_list; - struct drm_connector *conn = NULL, *conn_iter; - struct drm_crtc *drm_crtc; struct dpu_crtc_state *cstate; struct dpu_global_state *global_state; struct dpu_hw_blk *hw_pp[MAX_CHANNELS_PER_ENC]; @@ -959,7 +956,6 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, priv = drm_enc->dev->dev_private; dpu_kms = to_dpu_kms(priv->kms); - connector_list = &dpu_kms->dev->mode_config.connector_list; global_state = dpu_kms_get_existing_global_state(dpu_kms); if (IS_ERR_OR_NULL(global_state)) { @@ -969,22 +965,6 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, trace_dpu_enc_mode_set(DRMID(drm_enc)); - list_for_each_entry(conn_iter, connector_list, head) - if (conn_iter->encoder == drm_enc) - conn = conn_iter; - - if (!conn) { - DPU_ERROR_ENC(dpu_enc, "failed to find attached connector\n"); - return; - } else if (!conn->state) { - DPU_ERROR_ENC(dpu_enc, "invalid connector state\n"); - return; - } - - drm_for_each_crtc(drm_crtc, drm_enc->dev) - if (drm_crtc->state->encoder_mask & drm_encoder_mask(drm_enc)) - break; - /* Query resource that have been reserved in atomic check step. */ num_pp = dpu_rm_get_assigned_resources(&dpu_kms->rm, global_state, drm_enc->base.id, DPU_HW_BLK_PINGPONG, hw_pp, @@ -1001,7 +981,7 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, dpu_enc->hw_pp[i] = i < num_pp ? to_dpu_hw_pingpong(hw_pp[i]) : NULL; - cstate = to_dpu_crtc_state(drm_crtc->state); + cstate = to_dpu_crtc_state(crtc_state); for (i = 0; i < num_lm; i++) { int ctl_idx = (i < num_ctl) ? i : (num_ctl-1); @@ -1050,9 +1030,10 @@ static void dpu_encoder_virt_mode_set(struct drm_encoder *drm_enc, return; } - phys->connector = conn->state->connector; - if (phys->ops.mode_set) - phys->ops.mode_set(phys, mode, adj_mode); + phys->connector = conn_state->connector; + phys->cached_mode = crtc_state->adjusted_mode; + if (phys->ops.atomic_mode_set) + phys->ops.atomic_mode_set(phys, crtc_state, conn_state); } } @@ -2057,7 +2038,7 @@ static void dpu_encoder_frame_done_timeout(struct timer_list *t) } static const struct drm_encoder_helper_funcs dpu_encoder_helper_funcs = { - .mode_set = dpu_encoder_virt_mode_set, + .atomic_mode_set = dpu_encoder_virt_atomic_mode_set, .disable = dpu_encoder_virt_disable, .enable = dpu_encoder_virt_enable, .atomic_check = dpu_encoder_virt_atomic_check, diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index 159deb8ed7fb..6e80321b13c5 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -84,7 +84,7 @@ struct dpu_encoder_virt_ops { * @is_master: Whether this phys_enc is the current master * encoder. Can be switched at enable time. Based * on split_role and current mode (CMD/VID). - * @mode_set: DRM Call. Set a DRM mode. + * @atomic_mode_set: DRM Call. Set a DRM mode. * This likely caches the mode, for use at enable. * @enable: DRM Call. Enable a DRM mode. * @disable: DRM Call. Disable mode. @@ -115,9 +115,9 @@ struct dpu_encoder_phys_ops { struct dentry *debugfs_root); void (*prepare_commit)(struct dpu_encoder_phys *encoder); bool (*is_master)(struct dpu_encoder_phys *encoder); - void (*mode_set)(struct dpu_encoder_phys *encoder, - struct drm_display_mode *mode, - struct drm_display_mode *adjusted_mode); + void (*atomic_mode_set)(struct dpu_encoder_phys *encoder, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state); void (*enable)(struct dpu_encoder_phys *encoder); void (*disable)(struct dpu_encoder_phys *encoder); void (*destroy)(struct dpu_encoder_phys *encoder); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c index 45fe97fb612d..6de298d521ce 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c @@ -135,23 +135,13 @@ static void dpu_encoder_phys_cmd_underrun_irq(void *arg, int irq_idx) phys_enc); } -static void dpu_encoder_phys_cmd_mode_set( +static void dpu_encoder_phys_cmd_atomic_mode_set( struct dpu_encoder_phys *phys_enc, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { - struct dpu_encoder_phys_cmd *cmd_enc = - to_dpu_encoder_phys_cmd(phys_enc); struct dpu_encoder_irq *irq; - if (!mode || !adj_mode) { - DPU_ERROR("invalid args\n"); - return; - } - phys_enc->cached_mode = *adj_mode; - DPU_DEBUG_CMDENC(cmd_enc, "caching mode:\n"); - drm_mode_debug_printmodeline(adj_mode); - irq = &phys_enc->irq[INTR_IDX_CTL_START]; irq->irq_idx = phys_enc->hw_ctl->caps->intr_start; @@ -722,7 +712,7 @@ static void dpu_encoder_phys_cmd_init_ops( { ops->prepare_commit = dpu_encoder_phys_cmd_prepare_commit; ops->is_master = dpu_encoder_phys_cmd_is_master; - ops->mode_set = dpu_encoder_phys_cmd_mode_set; + ops->atomic_mode_set = dpu_encoder_phys_cmd_atomic_mode_set; ops->enable = dpu_encoder_phys_cmd_enable; ops->disable = dpu_encoder_phys_cmd_disable; ops->destroy = dpu_encoder_phys_cmd_destroy; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c index 1831fe37c88c..0c07db5021eb 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c @@ -348,19 +348,13 @@ static bool dpu_encoder_phys_vid_needs_single_flush( return phys_enc->split_role != ENC_ROLE_SOLO; } -static void dpu_encoder_phys_vid_mode_set( +static void dpu_encoder_phys_vid_atomic_mode_set( struct dpu_encoder_phys *phys_enc, - struct drm_display_mode *mode, - struct drm_display_mode *adj_mode) + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) { struct dpu_encoder_irq *irq; - if (adj_mode) { - phys_enc->cached_mode = *adj_mode; - drm_mode_debug_printmodeline(adj_mode); - DPU_DEBUG_VIDENC(phys_enc, "caching mode:\n"); - } - irq = &phys_enc->irq[INTR_IDX_VSYNC]; irq->irq_idx = phys_enc->hw_intf->cap->intr_vsync; @@ -662,7 +656,7 @@ static int dpu_encoder_phys_vid_get_frame_count( static void dpu_encoder_phys_vid_init_ops(struct dpu_encoder_phys_ops *ops) { ops->is_master = dpu_encoder_phys_vid_is_master; - ops->mode_set = dpu_encoder_phys_vid_mode_set; + ops->atomic_mode_set = dpu_encoder_phys_vid_atomic_mode_set; ops->enable = dpu_encoder_phys_vid_enable; ops->disable = dpu_encoder_phys_vid_disable; ops->destroy = dpu_encoder_phys_vid_destroy; From patchwork Thu Feb 3 08:26:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 539590 Delivered-To: patch@linaro.org Received: by 2002:ac0:f7d2:0:0:0:0:0 with SMTP id i18csp2223052imr; Thu, 3 Feb 2022 00:26:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWDeKta+mJW3PGD4S/dKBv/uP7qLqgh6ILx198Sf5dxcZ8iqwJx6QC0OqZzpG21hY5AJlM X-Received: by 2002:a05:6a00:24ce:: with SMTP id d14mr9608768pfv.0.1643876792414; Thu, 03 Feb 2022 00:26:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643876792; cv=none; d=google.com; s=arc-20160816; b=KWyK1QwcDtlBT4oMvt0M1UVgd6RFq/mSfYNXHq6MNsAb/Bl7DLVPveiBmQ9I8/rtrm 6TM+F3Wyf0WBYXmab2wTegrUVB9izNInjwTyqE84gIG50h3ukw4YnPVwKS1a0h27xYsZ +S2yoxFkvr+7Qe8OfYVK5FS+yZN+5F1/2j89TqEHQczj7faVwT25uXci1/OBRXlWNzFk g4QV4+YtZa+NgYA9YnY+2hENQ/mUrpOlyBu+2m7QpaFuztqY/rZuRpxoAuJ/BlHoX0/M eaebr/OYz3BgPTI1Z/0TCF7l6LmJdSukirP4RzyidAcSAcNHqlSl3DtkMc8PIORE0BlA bO6w== 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=HdSi3nMWEr1dk9VcTiRx+6Kl9ilPXNam2bjJyEs5WlA=; b=KnwcVxUY8QGgt6581qd9qr/zzNrbfKMdShVqgF4xx5FEJLWVDHg/66mfbnKORkeYAX 8UR2vE9DX3nW0vMFb3UZlj4jxyoMI3cT/ych4bkm9Ry7gRrKKgFEkJgotK3wnAgAUOyY 1v5wICwz2KBHAZXj8a7h4cORsYKxY6WJ5ZDvFZoUesMp5EZwt7mNYq6ZkD7e8apngWPC KOCOJxWkcq26e9/ibbC8OdiWd2RrHRsh3aTYn7wJYMin0E/6zG3wkgQrpqXFdLrfLi9w AyTa04pFTnGXOWjIe25qnQJqFC8jqTal/mR5xs9YwNXZxfK8NWhUGi172fJMgsW2Upuq 7BfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=nMOrvXIn; 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 bj8si24758470pgb.745.2022.02.03.00.26.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:32 -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=nMOrvXIn; 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 0BE7610EC20; Thu, 3 Feb 2022 08:26:25 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-lj1-x22a.google.com (mail-lj1-x22a.google.com [IPv6:2a00:1450:4864:20::22a]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6E34E10EBE3 for ; Thu, 3 Feb 2022 08:26:20 +0000 (UTC) Received: by mail-lj1-x22a.google.com with SMTP id c15so2738491ljf.11 for ; Thu, 03 Feb 2022 00:26:20 -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=HdSi3nMWEr1dk9VcTiRx+6Kl9ilPXNam2bjJyEs5WlA=; b=nMOrvXInD9QfJLdb/fan79KuA0cxJYB6CDwub/cuX1SUSIeZ+jIpwZahuXcvPktQwu Z0mAaho/2/1bci/Xm75jRn2cEky6fuaNHfAOGXZdClCX4darf6w9bHhB/naAOele0tcW b8uXzNCi0mD+iRnSKS5zN5ymyUbIohC8Og8ZVG0QTVvInuNJVBAxhJDFv/DOcHaPiYy+ a0dhNYtEaOJKBpdyIC5RBtaT2zD+IKRuWGN0QA/LujXjVPQBXDVbcrwbLsc7ySVQE3+u nLCaoELd4H56aGuHnRcR9/BUOswSiYtfdn/AVyP96qMgQsovvldxT2C1uOzjC4QSe17B y8yQ== 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=HdSi3nMWEr1dk9VcTiRx+6Kl9ilPXNam2bjJyEs5WlA=; b=HTIYIPF/BwAdjtuENVjV9aQJhdUrzMNhALssu3YPUNwi6qeFZJqxuxzHFeDJNlG9GE wqw8/aU1bFLy3bmzYfCzt0LbAoobxlz8u+YCvnya/Hku6jbUE3zteUbBBycuBVtCoqdg 71v03OqdRsaM61rBPc6Ac1CyclwotsP/rfCaDJdupUEyqUOpkpxGgQ8UNJKuqMP4uypg iCjyvb2w6udDMqxDbKbsJcuZtxH7gWzMosGb048Iascv9ZpknVwyYhMAQAUTgWsKgxcU 3S7x3ItCkKR/FwqE/Sb+u6T+qXq0vTXQOMBospOB4AIJN1pCU3M03s48yl1m4eglFiI1 YOKw== X-Gm-Message-State: AOAM530fEhxn4ubcveRx/4ktEL4B68wYbjdQPtT6gxxXTYx6AlCppSwW J654MjNJ0SCitLJzE+uncmEFHg== X-Received: by 2002:a2e:b703:: with SMTP id j3mr22061476ljo.228.1643876778587; Thu, 03 Feb 2022 00:26:18 -0800 (PST) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id n15sm4083440ljh.36.2022.02.03.00.26.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Feb 2022 00:26:18 -0800 (PST) From: Dmitry Baryshkov To: Bjorn Andersson , Rob Clark , Sean Paul , Abhinav Kumar Subject: [PATCH 7/7] drm/msm/dpu: pull connector from dpu_encoder_phys to dpu_encoder_virt Date: Thu, 3 Feb 2022 11:26:11 +0300 Message-Id: <20220203082611.2654810-8-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220203082611.2654810-1-dmitry.baryshkov@linaro.org> References: <20220203082611.2654810-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" All physical encoders used by virtual encoder share the same connector, so pull the connector field from dpu_encoder_phys into dpu_encoder_virt structure. Signed-off-by: Dmitry Baryshkov Reviewed-by: Abhinav Kumar --- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 11 ++++++----- drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h | 2 -- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c index 1462c426c14c..afafdaf48aea 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c @@ -143,6 +143,7 @@ enum dpu_enc_rc_states { * link between encoder/crtc. However in this case we need * to track crtc in the disable() hook which is called * _after_ encoder_mask is cleared. + * @connector: If a mode is set, cached pointer to the active connector * @crtc_kickoff_cb: Callback into CRTC that will flush & start * all CTL paths * @crtc_kickoff_cb_data: Opaque user data given to crtc_kickoff_cb @@ -183,6 +184,7 @@ struct dpu_encoder_virt { bool intfs_swapped; struct drm_crtc *crtc; + struct drm_connector *connector; struct dentry *debugfs_root; struct mutex enc_lock; @@ -993,6 +995,8 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, cstate->num_mixers = num_lm; + dpu_enc->connector = conn_state->connector; + for (i = 0; i < dpu_enc->num_phys_encs; i++) { int num_blk; struct dpu_hw_blk *hw_blk[MAX_CHANNELS_PER_ENC]; @@ -1030,7 +1034,6 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc, return; } - phys->connector = conn_state->connector; phys->cached_mode = crtc_state->adjusted_mode; if (phys->ops.atomic_mode_set) phys->ops.atomic_mode_set(phys, crtc_state, conn_state); @@ -1064,7 +1067,7 @@ static void _dpu_encoder_virt_enable_helper(struct drm_encoder *drm_enc) if (dpu_enc->disp_info.intf_type == INTF_DSI && !WARN_ON(dpu_enc->num_phys_encs == 0)) { - unsigned bpc = dpu_enc->phys_encs[0]->connector->display_info.bpc; + unsigned bpc = dpu_enc->connector->display_info.bpc; for (i = 0; i < MAX_CHANNELS_PER_ENC; i++) { if (!dpu_enc->hw_pp[i]) continue; @@ -1168,9 +1171,7 @@ static void dpu_encoder_virt_disable(struct drm_encoder *drm_enc) dpu_encoder_resource_control(drm_enc, DPU_ENC_RC_EVENT_STOP); - for (i = 0; i < dpu_enc->num_phys_encs; i++) { - dpu_enc->phys_encs[i]->connector = NULL; - } + dpu_enc->connector = NULL; DPU_DEBUG_ENC(dpu_enc, "encoder disabled\n"); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h index 6e80321b13c5..5093810f6663 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h @@ -174,7 +174,6 @@ struct dpu_encoder_irq { * tied to a specific panel / sub-panel. Abstract type, sub-classed by * phys_vid or phys_cmd for video mode or command mode encs respectively. * @parent: Pointer to the containing virtual encoder - * @connector: If a mode is set, cached pointer to the active connector * @ops: Operations exposed to the virtual encoder * @parent_ops: Callbacks exposed by the parent to the phys_enc * @hw_mdptop: Hardware interface to the top registers @@ -203,7 +202,6 @@ struct dpu_encoder_irq { */ struct dpu_encoder_phys { struct drm_encoder *parent; - struct drm_connector *connector; struct dpu_encoder_phys_ops ops; const struct dpu_encoder_virt_ops *parent_ops; struct dpu_hw_mdp *hw_mdptop;