From: Emil Velikov <emil.l.velikov@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: "Mauro Santos" <registo.mailling@gmail.com>,
"Michel Dänzer" <michel@daenzer.net>,
emil.l.velikov@gmail.com
Subject: [PATCH libdrm 2/5] xf86drm: add plumbing to not retrieve PCI device revision
Date: Wed, 30 Nov 2016 20:35:08 +0000 [thread overview]
Message-ID: <20161130203511.18910-2-emil.l.velikov@gmail.com> (raw)
In-Reply-To: <20161130203511.18910-1-emil.l.velikov@gmail.com>
From: Emil Velikov <emil.velikov@collabora.com>
Will be used with the drmGetDevice[s]2 API.
Cc: Michel Dänzer <michel@daenzer.net>
Cc: Nicolai Hähnle <nhaehnle@gmail.com>
Cc: Mauro Santos <registo.mailling@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98502
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
xf86drm.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/xf86drm.c b/xf86drm.c
index c788c93..ddb8f9f 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -2947,7 +2947,8 @@ static int drmGetMaxNodeName(void)
}
static int drmParsePciDeviceInfo(int maj, int min,
- drmPciDeviceInfoPtr device)
+ drmPciDeviceInfoPtr device,
+ uint32_t flags)
{
#ifdef __linux__
char path[PATH_MAX + 1];
@@ -3000,7 +3001,8 @@ void drmFreeDevices(drmDevicePtr devices[], int count)
static int drmProcessPciDevice(drmDevicePtr *device,
const char *node, int node_type,
- int maj, int min, bool fetch_deviceinfo)
+ int maj, int min, bool fetch_deviceinfo,
+ uint32_t flags)
{
const int max_node_str = ALIGN(drmGetMaxNodeName(), sizeof(void *));
int ret, i;
@@ -3039,7 +3041,7 @@ static int drmProcessPciDevice(drmDevicePtr *device,
addr += sizeof(drmPciBusInfo);
(*device)->deviceinfo.pci = (drmPciDeviceInfoPtr)addr;
- ret = drmParsePciDeviceInfo(maj, min, (*device)->deviceinfo.pci);
+ ret = drmParsePciDeviceInfo(maj, min, (*device)->deviceinfo.pci, flags);
if (ret)
goto free_device;
}
@@ -3095,6 +3097,7 @@ int drmGetDevice(int fd, drmDevicePtr *device)
int ret, i, node_count;
int max_count = 16;
dev_t find_rdev;
+ uint32_t flags = 0;
if (fd == -1 || device == NULL)
return -EINVAL;
@@ -3142,7 +3145,7 @@ int drmGetDevice(int fd, drmDevicePtr *device)
switch (subsystem_type) {
case DRM_BUS_PCI:
- ret = drmProcessPciDevice(&d, node, node_type, maj, min, true);
+ ret = drmProcessPciDevice(&d, node, node_type, maj, min, true, flags);
if (ret)
goto free_devices;
@@ -3216,6 +3219,7 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
int maj, min;
int ret, i, node_count, device_count;
int max_count = 16;
+ uint32_t flags = 0;
local_devices = calloc(max_count, sizeof(drmDevicePtr));
if (local_devices == NULL)
@@ -3251,7 +3255,7 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
switch (subsystem_type) {
case DRM_BUS_PCI:
ret = drmProcessPciDevice(&device, node, node_type,
- maj, min, devices != NULL);
+ maj, min, devices != NULL, flags);
if (ret)
goto free_devices;
--
2.10.2
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-11-30 20:35 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-30 20:35 [PATCH libdrm 1/5] xf86drm: use maj/min in drmParsePciDeviceInfo() Emil Velikov
2016-11-30 20:35 ` Emil Velikov [this message]
2016-11-30 20:35 ` [PATCH libdrm 3/5] xf86drm: parse the separate sysfs files for vendor... info Emil Velikov
2016-11-30 20:35 ` [PATCH libdrm 4/5] xf86drm: introduce drmGetDevice[s]2 Emil Velikov
2016-12-01 3:09 ` Michel Dänzer
2016-12-01 3:56 ` Michel Dänzer
2016-12-01 13:35 ` Emil Velikov
2016-11-30 20:35 ` [PATCH libdrm 5/5] tests/drmdevice: use drmGetDevice[s]2 Emil Velikov
-- strict thread matches above, loose matches on Subject: below --
2016-12-02 16:32 [PATCH libdrm 1/5] xf86drm: use maj/min in drmParsePciDeviceInfo() Emil Velikov
2016-12-02 16:32 ` [PATCH libdrm 2/5] xf86drm: add plumbing to not retrieve PCI device revision Emil Velikov
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=20161130203511.18910-2-emil.l.velikov@gmail.com \
--to=emil.l.velikov@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=michel@daenzer.net \
--cc=registo.mailling@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).