From patchwork Thu Jun 16 21:32:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 12884877 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CB3DEC43334 for ; Thu, 16 Jun 2022 21:34:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wJdivINpq42OCY0S7fjF1mujcqs2sd+a6k9Q1yyIIIU=; b=yG/FQ/2QyyhWLe IOYidiI7dCBw8woyLrfRXWYpErdOdZox0PihK+Wqbda4LRf5BhN++TaSyLV9ikbF1uxVqu8VpNmkM /t/0Ul4D+HdzjA7l3FhVvbcdozd9hU2XEO9iOifB8vceykB7dKfQAWItpKyv/wAZolkshP08Df4yn w7472LebYjfls2lYP48D6EhlLNsx1ZFLftq1gBXb72HyAC81n+i0GAxc3UQm41oyhsrzcC2vNhZPB VGQehWLlD9ZcOGOH6YVzabJeOjfPoi69ld/VqewtlDmdO+ce3nob3zHwrwlOphSTQSYc2clf5QrFU owx3gdEetKGuXeA4QSag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1x75-004RpX-61; Thu, 16 Jun 2022 21:33:15 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1x72-004RoV-Nw for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 21:33:13 +0000 Received: by mail-ed1-x52f.google.com with SMTP id b8so3837760edj.11 for ; Thu, 16 Jun 2022 14:33:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=laSJoDIgvQBCTId5pVKj53fMxGvIURwK5+ffKs0ASlY=; b=UBd17f/1SnZchYlExkTEs7FEuYTDz5ujzCzXm/SGFxfc7vQJ4lD7bhjBqiIPj2yGEY OwWwEycnPAU139vVsRVxUyNnf6H75fg5PESXPcSy4hSPmAVLjAgzMN7gutw+N7PP/V/n 4Xha3koafKzw6BNAP+dZFpiWU3OKxLzLTXz5t7r/ZXiv/OgndLmncmtxxVKo22qgcomS nTxiiFAiPY6wxRbda4CwsKu1nSWydVfLTtRpNEv6aAzv+AsbfvhPMIOeOhCoOLZPP9Ws w+cmzNI/W2M1sMrVY8ka2YLMDqLl5axbTOql/Vt16eIKZ39AGlUcV6dPfCwO1RUQQdn0 B45w== 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=laSJoDIgvQBCTId5pVKj53fMxGvIURwK5+ffKs0ASlY=; b=0Lke1151MXurY5g4Ec3ruOyoLP058PxapeOy+/Ztu/FTiPECypNfYT6rAgNZrmR9Sh BjdkJ2ECgbsZ33N35CsH28x27sXHkF1UCr6WNNtC4D8WqSggVl16KQph1pTvkyRO0xrN ExbIrwr56oY4np1jMUd8sQTQGSNVrL+gbMSnS1QbNmtBSq3sAeXu4nuzhDeEpVTXjJzC pu+sm6m1zU6i80Jg2hA8kBritNUgYIXOh1n36F908stP1TgJQr7lr8iB7wH41jomwakE 6gvbfaJ97FlHOx1HP5o2GVq6Nwc50rVx9RAqImGj99gNdL+BuYoc3ZB8oiFwCZWe4t8G uR8g== X-Gm-Message-State: AJIora95L2mL9PS6JbH50Kk3AmqOoGdvLFfhfuQtt9PKpV3Sbg3u2dSe 7rmLYHQDV/FYWtlM3gA8B6A= X-Google-Smtp-Source: AGRyM1smWRQNfSGi+fNS3fxjPTkk1JtE/FL1CrltkwNtsatE8j54xbfVNS+Jv1BDstvw0sEj54qO3A== X-Received: by 2002:aa7:c857:0:b0:433:5c62:ddbc with SMTP id g23-20020aa7c857000000b004335c62ddbcmr8865690edt.218.1655415189047; Thu, 16 Jun 2022 14:33:09 -0700 (PDT) Received: from kista.localdomain (213-161-3-76.dynamic.telemach.net. [213.161.3.76]) by smtp.gmail.com with ESMTPSA id d5-20020a170906304500b0070f7d1c5a18sm1241230ejd.55.2022.06.16.14.33.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jun 2022 14:33:08 -0700 (PDT) From: Jernej Skrabec To: mripard@kernel.org, wens@csie.org Cc: airlied@linux.ie, daniel@ffwll.ch, samuel@sholland.org, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH] drm/sun4i: Add DMA mask and segment size Date: Thu, 16 Jun 2022 23:32:40 +0200 Message-Id: <20220616213240.392041-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_143312_817799_EE62DD62 X-CRM114-Status: GOOD ( 11.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Kernel occasionally complains that there is mismatch in segment size when trying to render HW decoded videos and rendering them directly with sun4i DRM driver. Fix that by setting DMA mask and segment size. Signed-off-by: Jernej Skrabec --- drivers/gpu/drm/sun4i/sun4i_drv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/sun4i/sun4i_drv.c b/drivers/gpu/drm/sun4i/sun4i_drv.c index 275f7e4a03ae..83f4e87f77f6 100644 --- a/drivers/gpu/drm/sun4i/sun4i_drv.c +++ b/drivers/gpu/drm/sun4i/sun4i_drv.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -367,6 +368,9 @@ static int sun4i_drv_probe(struct platform_device *pdev) INIT_KFIFO(list.fifo); + dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); + dma_set_max_seg_size(&pdev->dev, DMA_BIT_MASK(32)); + for (i = 0;; i++) { struct device_node *pipeline = of_parse_phandle(np, "allwinner,pipelines",