From: Thierry Reding <thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
To: Arto Merilainen <amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: "dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC libdrm] Add NVIDIA Tegra support
Date: Wed, 5 Dec 2012 08:46:29 +0100 [thread overview]
Message-ID: <20121205074629.GA13386@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <50BEFA1F.5090907-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]
On Wed, Dec 05, 2012 at 09:39:11AM +0200, Arto Merilainen wrote:
> On 12/04/2012 05:13 PM, Thierry Reding wrote:
> >+int drm_tegra_open(const char *path, struct drm_tegra **devicep)
> >+{
> >+ struct drm_tegra *device;
> >+ int err;
> >+
> >+ if (!path || !devicep)
> >+ return -EINVAL;
> >+
> >+ device = calloc(1, sizeof(*device));
> >+ if (!device)
> >+ return -ENOMEM;
> >+
> >+ DRMINITLISTHEAD(&device->bo_list);
> >+
> >+ device->fd = open(path, O_RDWR);
> >+ if (device->fd < 0) {
> >+ err = -errno;
> >+ free(device);
> >+ return err;
> >+ }
> >+
> >+ *devicep = device;
> >+
> >+ return 0;
> >+}
>
> I think you shouldn't ask the path from the application (=DDX) here,
> but use drmOpen() that automatically finds the correct device for
> you.
>
> I'd also prefer letting the application open and close the device
> and modify drm_tegra_open() to take the fd as a parameter. That way
> the DDX could easily access also all generic libdrm functions.
Good points, I'll take those into account.
Thanks,
Thierry
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
prev parent reply other threads:[~2012-12-05 7:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-04 15:13 [RFC libdrm] Add NVIDIA Tegra support Thierry Reding
[not found] ` <1354634032-9986-1-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-12-04 15:13 ` Thierry Reding
2012-12-04 15:28 ` Rob Clark
[not found] ` <CAF6AEGum=cOxcHN1fBNfpLpm=bC-dXHZ_h2u96Ek4gwQSWSTtw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-12-04 15:38 ` Thierry Reding
[not found] ` <1354634032-9986-2-git-send-email-thierry.reding-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2012-12-05 7:39 ` Arto Merilainen
[not found] ` <50BEFA1F.5090907-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2012-12-05 7:46 ` Thierry Reding [this message]
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=20121205074629.GA13386@avionic-0098.adnet.avionic-design.de \
--to=thierry.reding-rm9k5ik7kjkj5m59nbduvrnah6klmebb@public.gmane.org \
--cc=amerilainen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.