From: Dmitry Osipenko <digetx@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: linux-tegra@vger.kernel.org, dri-devel@lists.freedesktop.org,
Mikko Perttunen <mperttunen@nvidia.com>
Subject: Re: [PATCH 5/7] drm/tegra: gr3d: Track interface version
Date: Fri, 18 May 2018 19:02:40 +0300 [thread overview]
Message-ID: <7f4b756b-9df2-6381-ff02-a98a37a873a9@gmail.com> (raw)
In-Reply-To: <20180517154132.10058-6-thierry.reding@gmail.com>
On 17.05.2018 18:41, Thierry Reding wrote:
> From: Thierry Reding <treding@nvidia.com>
>
> Set the interface version implemented by the gr3d module. This allows
> userspace to pass the correct command stream when programming the gr3d
> module.
>
> Signed-off-by: Thierry Reding <treding@nvidia.com>
> ---
> drivers/gpu/drm/tegra/gr3d.c | 28 +++++++++++++++++++++++++---
> 1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/gr3d.c b/drivers/gpu/drm/tegra/gr3d.c
> index 28c4ef63065b..0d4dce978eb2 100644
> --- a/drivers/gpu/drm/tegra/gr3d.c
> +++ b/drivers/gpu/drm/tegra/gr3d.c
> @@ -10,6 +10,7 @@
> #include <linux/clk.h>
> #include <linux/host1x.h>
> #include <linux/module.h>
> +#include <linux/of_device.h>
> #include <linux/platform_device.h>
> #include <linux/reset.h>
>
> @@ -19,6 +20,10 @@
> #include "gem.h"
> #include "gr3d.h"
>
> +struct gr3d_soc {
> + unsigned int version;
> +};
> +
> struct gr3d {
> struct tegra_drm_client client;
> struct host1x_channel *channel;
> @@ -27,6 +32,8 @@ struct gr3d {
> struct reset_control *rst_secondary;
> struct reset_control *rst;
>
> + const struct gr3d_soc *soc;
> +
> DECLARE_BITMAP(addr_regs, GR3D_NUM_REGS);
> };
>
> @@ -125,10 +132,22 @@ static const struct tegra_drm_client_ops gr3d_ops = {
> .submit = tegra_drm_submit,
> };
>
> +static const struct gr3d_soc tegra20_gr3d_soc = {
> + .version = 0x20,
> +};
> +
> +static const struct gr3d_soc tegra30_gr3d_soc = {
> + .version = 0x30,
> +};
> +
> +static const struct gr3d_soc tegra114_gr3d_soc = {
> + .version = 0x35,
> +};
> +
> static const struct of_device_id tegra_gr3d_match[] = {
> - { .compatible = "nvidia,tegra114-gr3d" },
> - { .compatible = "nvidia,tegra30-gr3d" },
> - { .compatible = "nvidia,tegra20-gr3d" },
> + { .compatible = "nvidia,tegra114-gr3d", .data = &tegra114_gr3d_soc },
> + { .compatible = "nvidia,tegra30-gr3d", .data = &tegra30_gr3d_soc },
> + { .compatible = "nvidia,tegra20-gr3d", .data = &tegra20_gr3d_soc },
> { }
> };
> MODULE_DEVICE_TABLE(of, tegra_gr3d_match);
> @@ -250,6 +269,8 @@ static int gr3d_probe(struct platform_device *pdev)
> if (!gr3d)
> return -ENOMEM;
>
> + gr3d->soc = of_device_get_match_data(&pdev->dev);
> +
> syncpts = devm_kzalloc(&pdev->dev, sizeof(*syncpts), GFP_KERNEL);
> if (!syncpts)
> return -ENOMEM;
> @@ -303,6 +324,7 @@ static int gr3d_probe(struct platform_device *pdev)
> gr3d->client.base.ops = &gr3d_client_ops;
> gr3d->client.base.dev = &pdev->dev;
> gr3d->client.base.class = HOST1X_CLASS_GR3D;
> + gr3d->client.base.version = gr3d->soc->version;
> gr3d->client.base.syncpts = syncpts;
> gr3d->client.base.num_syncpts = 1;
>
>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Tested-by: Dmitry Osipenko <digetx@gmail.com>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-05-18 17:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-17 15:41 [PATCH 0/7] drm/tegra: Preparation work for destaging ABI Thierry Reding
2018-05-17 15:41 ` [PATCH 1/7] drm/tegra: Use proper arguments for DRM_TEGRA_CLOSE_CHANNEL IOCTL Thierry Reding
2018-05-18 16:00 ` Dmitry Osipenko
2018-05-17 15:41 ` [PATCH 2/7] drm/tegra: gem: Fill in missing export info Thierry Reding
2018-05-18 16:00 ` Dmitry Osipenko
2018-05-17 15:41 ` [PATCH 3/7] drm/tegra: dc: Support rotation property Thierry Reding
2018-05-18 17:37 ` Dmitry Osipenko
2018-05-17 15:41 ` [PATCH 4/7] drm/tegra: gr2d: Track interface version Thierry Reding
2018-05-18 16:05 ` Dmitry Osipenko
2018-05-17 15:41 ` [PATCH 5/7] drm/tegra: gr3d: " Thierry Reding
2018-05-18 16:02 ` Dmitry Osipenko [this message]
2018-05-17 15:41 ` [PATCH 6/7] drm/tegra: vic: " Thierry Reding
2018-05-18 16:05 ` Dmitry Osipenko
2018-05-17 15:41 ` [PATCH 7/7] drm/tegra: Add kerneldoc for UAPI Thierry Reding
2018-05-18 17:19 ` Dmitry Osipenko
2018-05-18 20:12 ` Thierry Reding
2018-05-18 21:07 ` Dmitry Osipenko
2018-05-18 22:01 ` Thierry Reding
2018-05-18 20:33 ` [PATCH v2] " Thierry Reding
2018-05-18 21:42 ` Dmitry Osipenko
2018-05-18 21:58 ` Thierry Reding
2018-05-18 22:13 ` Thierry Reding
2018-05-18 22:18 ` Dmitry Osipenko
2018-05-18 22:24 ` Thierry Reding
2018-05-18 22:28 ` Dmitry Osipenko
2018-05-18 22:35 ` Thierry Reding
2018-05-18 22:45 ` Dmitry Osipenko
2018-05-23 8:59 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7f4b756b-9df2-6381-ff02-a98a37a873a9@gmail.com \
--to=digetx@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mperttunen@nvidia.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).