linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: Terje Bergstrom <tbergstrom@nvidia.com>
Cc: thierry.reding@avionic-design.de, airlied@linux.ie,
	dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHv4 8/8] gpu: host1x: Register DRM dummy device
Date: Fri, 21 Dec 2012 14:53:51 +0100	[thread overview]
Message-ID: <1356098031.1490.111.camel@tellur> (raw)
In-Reply-To: <1356089964-5265-9-git-send-email-tbergstrom@nvidia.com>

Am Freitag, den 21.12.2012, 13:39 +0200 schrieb Terje Bergstrom:
> Register a dummy device for tegradrm, and provide a getter to
> access the device.
> 
> Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
> ---
[...]
> diff --git a/drivers/gpu/host1x/drm.c b/drivers/gpu/host1x/drm.c
> new file mode 100644
> index 0000000..eaaaeed
> --- /dev/null
> +++ b/drivers/gpu/host1x/drm.c
> @@ -0,0 +1,51 @@
> +/*
> + * Tegra host1x driver DRM dummy device
> + *
> + * Copyright (c) 2012, NVIDIA Corporation.
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms and conditions of the GNU General Public License,
> + * version 2, as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope it will be useful, but WITHOUT
> + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
> + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
> + * more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program.  If not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <linux/platform_device.h>
> +#include <linux/dma-mapping.h>
> +#include <linux/module.h>
> +#include "drm.h"
> +#include "dev.h"
> +
> +int host1x_register_drm_device(struct host1x *host1x)
> +{
> +	struct platform_device *drm_device;
> +
> +	drm_device = platform_device_register_simple("tegradrm", -1, NULL, 0);
> +	if (!drm_device)
> +		return -ENOMEM;
> +	dma_set_coherent_mask(&drm_device->dev, DMA_BIT_MASK(32));
> +
This might not be necessary once we move the allocator to host1x.

> +	host1x->drm_device = drm_device;
> +	return 0;
> +}
> +EXPORT_SYMBOL(host1x_register_drm_device);
> +
> +void host1x_unregister_drm_device(struct host1x *host1x)
> +{
> +	if (host1x->drm_device)
> +		platform_device_unregister(host1x->drm_device);
> +}
> +EXPORT_SYMBOL(host1x_unregister_drm_device);
> +
> +struct platform_device *host1x_drm_device(struct platform_device *pdev)
> +{
> +	struct host1x *host = platform_get_drvdata(pdev);
> +	return host->drm_device;
> +}
> +EXPORT_SYMBOL(host1x_drm_device);
This should be called host1x_get_drm_device





  reply	other threads:[~2012-12-21 13:53 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-21 11:39 [PATCHv4 0/8] Support for Tegra 2D hardware Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 1/8] gpu: host1x: Add host1x driver Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 2/8] gpu: host1x: Add syncpoint wait and interrupts Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 3/8] gpu: host1x: Add channel support Terje Bergstrom
2012-12-22  4:17   ` Steven Rostedt
2013-01-02  9:31     ` Terje Bergström
2013-01-02  7:40   ` Mark Zhang
2013-01-02  9:31     ` Terje Bergström
2013-01-02  9:31       ` Mark Zhang
2013-01-02  9:43         ` Terje Bergström
2012-12-21 11:39 ` [PATCHv4 4/8] gpu: host1x: Add debug support Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 5/8] drm: tegra: Remove redundant host1x Terje Bergstrom
2012-12-21 14:36   ` Thierry Reding
2012-12-22  6:50     ` Terje Bergström
2012-12-25  5:25       ` Stephen Warren
2012-12-28 21:21         ` Thierry Reding
2012-12-31  6:43           ` Terje Bergström
2013-01-03 17:58     ` Terje Bergström
2012-12-21 11:39 ` [PATCHv4 6/8] ARM: tegra: Add board data and 2D clocks Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 7/8] drm: tegra: Add gr2d device Terje Bergstrom
2012-12-21 11:39 ` [PATCHv4 8/8] gpu: host1x: Register DRM dummy device Terje Bergstrom
2012-12-21 13:53   ` Lucas Stach [this message]
2012-12-21 14:09     ` Thierry Reding
2012-12-21 13:50 ` [PATCHv4 0/8] Support for Tegra 2D hardware Lucas Stach
2012-12-21 13:57   ` Terje Bergström
2012-12-21 13:59     ` Lucas Stach
2013-01-03  6:14   ` Terje Bergström
2012-12-26  9:42 ` Mark Zhang
2013-01-02  9:25   ` Terje Bergström
2013-01-03  2:36     ` Mark Zhang
2012-12-28  9:14 ` Mark Zhang
2013-01-02  9:42   ` Terje Bergström
2013-01-03  3:31     ` Mark Zhang
2013-01-03  5:50       ` Terje Bergström
2013-01-03  5:55         ` Mark Zhang

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=1356098031.1490.111.camel@tellur \
    --to=dev@lynxeye.de \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=tbergstrom@nvidia.com \
    --cc=thierry.reding@avionic-design.de \
    /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).