Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp421689rdb; Thu, 22 Feb 2024 07:50:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXEhPeW/Ax0R/EvBDUtmxBxiIH5YBv2+wCGcF4WVUNaqDo3KJP/qMSO6uylcS9eOWSfwf1JcbV3TIQUyPUKjiIptINXUToBXP7aIaPazA== X-Google-Smtp-Source: AGHT+IFRYSi3HRLCamShpdDQmfyMW4mjusP3gkcWc1raD6uhn11ZeH9KaSCFFyE7vqBnPHLQrlqf X-Received: by 2002:a05:6a00:4c8b:b0:6e4:c850:55b2 with SMTP id eb11-20020a056a004c8b00b006e4c85055b2mr3512758pfb.5.1708617049964; Thu, 22 Feb 2024 07:50:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708617049; cv=pass; d=google.com; s=arc-20160816; b=WpAndl4yqc5QAN2JnbZDixLSUWjmuJI5DuNuonutD5a7j9cu84PX7p14a4t0DR4Dxj 0MmfF2qtfCpHDrooRABDgj9bAgDvdLAwACTarjNajA/mLHUD2zSiqhUaBiffW+l6Xlkr Uu0GeM5okA/4EgMwfIsqjqqYi7uRh/u6iTisNImzplItoNRXRlZAbmQ4lH4lcpYaOOxL lNmgXvX9iO8C0Z8M+8Jztu1GC1FGIjNfHGX+ElR+RhRHBQ7MHrQqPIm/KmpQ0/IeZsYC 1mMBXq+0ZfuFiViROcDo4htBUNf3Mb0whug82iM5mMl6ByjJQEDlyhz/4JoB5pWiNtFA N10A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=VmU5djMcZq3un9NXE8bxt+eQx9GKGrESkVjr84+O68E=; fh=vD8tJ9d2mp7H51jNKyMUDglMjHY1Ew4hzsuiSabS+YY=; b=UVdaJEEsAQwNDmmDN8ih+9bDU0ou0aFcADNjEFa3/kI8qsQIk0RMOjDN3uscQVdt4n FsmY+fJADx1pooj8MBLHFQBMgMHtCckGug8MpTcSc0hkmnyqOSlnmy6opposNnYCJ+0g SfTiApY4sDxfrp7sh3g5AdMY2yoszWp+UQ66HYTZoLr5V1nHl8GTKEDFtMPImDk+UrZn XROdLvsIqfq5BHmtRuu1jyYFA1xwzgFZeVcii3SCRyi8MnZyNVB6n2eYB0gvYKC++uDw UlNLXXEZziDF39o2unv+NujdiEK9q8vOqBpweu3vx+BlNdxaV30pjZn3RF4R7lFLmosh GBiQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qcu2M+N4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76806-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id v5-20020a655c45000000b005dc49182879si10322027pgr.409.2024.02.22.07.50.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 07:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76806-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qcu2M+N4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-76806-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76806-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id C9C0EB25C1A for ; Thu, 22 Feb 2024 15:45:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FA2F157E77; Thu, 22 Feb 2024 15:41:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="qcu2M+N4" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AACE715699D; Thu, 22 Feb 2024 15:41:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708616514; cv=none; b=XGE2wKggdA+VZycSqGyUG8E57kEahit7mvq8UykqXSKxXASWdrTGxmB+XNgG7MbVTvU2PqOOV+HIjlt2SeQLDZyF1Gpv2+6Fk455ROUO1f1jFo7cTaqlHnM35pIVcXkAQNC3uUHwlvHlP0+QbkQR8QTwjS4uUs985o0D3zSNFKA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708616514; c=relaxed/simple; bh=TyYfmOPE/p3NSd8TeId10uLJdlRXk+ZcnArj63ZnB78=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=lDE/s7P2chuw6HbAq6l1VWiSD6EXfkjCFkrj3Nak0zNR02eGl3GMhTAVEKqw5+XKJTIXQzUxPG6gVgup/ceHLeVLrbvxddqzt022Xh6keW85T+XSGp4664AHzAUmbkQhExrkARcuDbw9l1/+ANowX7gLoRCMQ3iClA05fjW+gsM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=qcu2M+N4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B457CC433C7; Thu, 22 Feb 2024 15:41:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708616514; bh=TyYfmOPE/p3NSd8TeId10uLJdlRXk+ZcnArj63ZnB78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qcu2M+N40lnWO0VRIjirr4tmgHxDycIihP1hNLX/vwGiRrExvp4aZrtKxMjGVbO/W CBLfCfyrPZH7R+m/3nGdAvmq/SDiPRQg0oGXxG8peloIbT/vIJMbsk4YROvB16QtZg 7chEHJhemcr7VY6Cda3yNzVUcCbZdmdbvEgbBBu2mnARRfTGrmNgSUOHm0mH7Fp/DN mfSKHNVYx0WbaDJ7SaRIWbPGejb4IbGX/0YX69D8G9lhcLvLDIkZqvFnGfPnXfRN5E oT/eQXFrH2F0Fq47VyZuN8iiG7CgBgBDdqLxgpXg6znePkxnGLTDcfbrRthubA1kdn xp2RIuy2lFMXg== From: Chun-Kuang Hu To: Matthias Brugger , AngeloGioacchino Del Regno , Mauro Carvalho Chehab , Moudy Ho , "Jason-JH . Lin" , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Chun-Kuang Hu Subject: [PATCH v2 08/12] drm/mediatek: Use cmdq_pkt_eoc() instead of cmdq_pkt_finalize() Date: Thu, 22 Feb 2024 15:41:16 +0000 Message-Id: <20240222154120.16959-9-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240222154120.16959-1-chunkuang.hu@kernel.org> References: <20240222154120.16959-1-chunkuang.hu@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit For some client driver, it want to reduce latency between excuting previous packet command and next packet command, so append jump command to the end of previous packet and the jump destination address is the start address of next packet command buffer. Before next packet exist, the previous packet has no information of where to jump to, so append nop command first. When next packet exist, change nop command to jump command. For mediatek drm driver, it never has next packet, so appending nop command is redundant. Because cmdq_pkt_finalize() would append nop command, so change calling cmdq_pkt_finalize() to cmdq_pkt_eoc() to prevent append redundant nop command. Signed-off-by: Chun-Kuang Hu --- drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c index c729af3b9822..df693fa268ce 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_crtc.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_crtc.c @@ -593,7 +593,7 @@ static void mtk_drm_crtc_update_config(struct mtk_drm_crtc *mtk_crtc, cmdq_pkt_clear_event(cmdq_handle, mtk_crtc->cmdq_event); cmdq_pkt_wfe(cmdq_handle, mtk_crtc->cmdq_event, false); mtk_crtc_ddp_config(crtc, cmdq_handle); - cmdq_pkt_finalize(cmdq_handle); + cmdq_pkt_eoc(cmdq_handle); dma_sync_single_for_device(mtk_crtc->cmdq_client.chan->mbox->dev, cmdq_handle->pa_base, cmdq_handle->cmd_buf_size, -- 2.34.1