From patchwork Mon Oct 14 12:50:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 11188693 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A6A5912 for ; Mon, 14 Oct 2019 12:51:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 724A720673 for ; Mon, 14 Oct 2019 12:51:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 724A720673 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 65DCF6E2BC; Mon, 14 Oct 2019 12:51:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by gabe.freedesktop.org (Postfix) with ESMTPS id BC0196E2B2 for ; Mon, 14 Oct 2019 12:51:03 +0000 (UTC) Received: by mail-wm1-x344.google.com with SMTP id 7so17171898wme.1 for ; Mon, 14 Oct 2019 05:51:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=G8Ip/N74ctxJJIwGKeqriyFtdTULY1VY4q99IhD7qRM=; b=Mkd3Qhc8Wh47FOs/jUSI+oovkpEfaWNixyzlS+iEtOKzP+NDCrwWVU265pFC3gU1ic GDTWQX+c7CE05c+XmESPnO1tQZJvAxsd4sk2EMMXordMm+1ehnkNRfOA0riSkKVkCh2C 8MCJ3hGlBz/PyCkFBhe5gbzIMR6tz9YgnPEHVv7IwqDO9WTpFguFa1RpnyTqMcswEZ22 CT+wRaQ5xilAzoGxWBda9qPHsWjw15GcAxXjRWp3BsDRP0d/STJHTIiCTv//eQSs7QPt cWpiJ1G8dd1f0CV4mu5M9qgvdYOOj5IVyymZhhRgqNUlWyrSmvqZ+ys4BK5Szp1wPdGP lIeA== X-Gm-Message-State: APjAAAUhJe6JFwW16a281P4lT1f5h38RfSL7SZdd8MlNviz48XVRnbml ub1z+v3Mjf3Y1alGDAN9DFkTKZIs X-Google-Smtp-Source: APXvYqwy8ad1by41Gb786EPOSxMUzFJ4fHUkh7WWE+RcLVZpFH7w5ydP5oTR7CWjvEhiKXk3grAFmQ== X-Received: by 2002:a1c:ac02:: with SMTP id v2mr11162902wme.85.1571057462130; Mon, 14 Oct 2019 05:51:02 -0700 (PDT) Received: from localhost (p2E5BE2CE.dip0.t-ipconnect.de. [46.91.226.206]) by smtp.gmail.com with ESMTPSA id l7sm18312749wrv.77.2019.10.14.05.51.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 05:51:01 -0700 (PDT) From: Thierry Reding To: Thierry Reding Subject: [PATCH 05/14] drm/tegra: Inherit device DMA parameters from host1x Date: Mon, 14 Oct 2019 14:50:40 +0200 Message-Id: <20191014125049.425101-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191014125049.425101-1-thierry.reding@gmail.com> References: <20191014125049.425101-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G8Ip/N74ctxJJIwGKeqriyFtdTULY1VY4q99IhD7qRM=; b=a6UPelncewmDN9UTVzqDbpUmI9eu9bTh6bxy9nRXld4JwG3EVLAm3e06C3HA577Sv1 QHP5J78GPFogvs6g3WMyHnKzY9Oqw94QVzNn1g9OrBs3Oj07LAkxqz5I8WNR5ZZi8MHR iLsysrgZLneZNwqixOsZUzJaKfimn+4au/Ai31U/WASpDeF9WweuGelfgEN4OvxznALR lTR5/bvHA824s1VLAWOzUWEvLosCs/f8LeECsUD2aQTrR+61yvSqi+Q3OyQw4nYhtybO Act5WdkDXd+GYETwDO+CWFi2NiopIvXTHNJKkZstRgJQulH4eHae5YnT717G65LEiWLH Itpw== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Thierry Reding The display controllers and VIC don't have any limitations on the DMA segment size. Inherit the DMA parameters from the parent device, which also doesn't have any such limitations. Signed-off-by: Thierry Reding --- drivers/gpu/drm/tegra/dc.c | 9 +++++++++ drivers/gpu/drm/tegra/vic.c | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c index fbf57bc3cdab..f7f7984bb749 100644 --- a/drivers/gpu/drm/tegra/dc.c +++ b/drivers/gpu/drm/tegra/dc.c @@ -2074,6 +2074,12 @@ static int tegra_dc_init(struct host1x_client *client) goto cleanup; } + /* + * Inherit the DMA parameters (such as maximum segment size) from the + * parent device. + */ + client->dev->dma_parms = client->parent->dma_parms; + return 0; cleanup: @@ -2097,6 +2103,9 @@ static int tegra_dc_exit(struct host1x_client *client) if (!tegra_dc_has_window_groups(dc)) return 0; + /* avoid a dangling pointer just in case this disappears */ + client->dev->dma_parms = NULL; + devm_free_irq(dc->dev, dc->irq, dc); err = tegra_dc_rgb_exit(dc); diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c index c97a61c877af..8d98b0cfc47b 100644 --- a/drivers/gpu/drm/tegra/vic.c +++ b/drivers/gpu/drm/tegra/vic.c @@ -214,6 +214,12 @@ static int vic_init(struct host1x_client *client) if (err < 0) goto free_syncpt; + /* + * Inherit the DMA parameters (such as maximum segment size) from the + * parent device. + */ + client->dev->dma_parms = client->parent->dma_parms; + return 0; free_syncpt: @@ -236,6 +242,9 @@ static int vic_exit(struct host1x_client *client) struct vic *vic = to_vic(drm); int err; + /* avoid a dangling pointer just in case this disappears */ + client->dev->dma_parms = NULL; + err = tegra_drm_unregister_client(tegra, drm); if (err < 0) return err;