From: Ben Skeggs <skeggsb-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
Christopher James Halse Rogers
<raof-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>,
Aaron Plattner
<aplattner-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Subject: Re: [PATCH] nv: improve KMS detection
Date: Mon, 24 May 2010 08:37:03 +1000 [thread overview]
Message-ID: <1274654223.7344.0.camel@nisroch> (raw)
In-Reply-To: <20100523194645.GA15846-OI9uyE9O0yo@public.gmane.org>
On Sun, 2010-05-23 at 21:46 +0200, Marcin Slusarz wrote:
> 1) DRICreatePCIBusID belongs to xserver dri module, so when it's
> unavailable we can't format string for drmCheckModesettingSupported.
> (This situation happened to me with KMS enabled and dri module moved
> somewhere else by Gentoo's "eselect opengl set nvidia" switcher)
> Open code DRICreatePCIBusID to drop dri dependency.
> 2) Once we dropped dependency on dri module (which linked to libdrm),
> we have to link directly to libdrm.
An alternative, which we use in Fedora for nv/vesa is to use
pci_device_has_kernel_driver() from libpciaccess.
Ben.
>
> Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
> src/Makefile.am | 2 +-
> src/nv_driver.c | 11 +++--------
> 2 files changed, 4 insertions(+), 9 deletions(-)
>
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 5d57010..8b23e21 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -25,7 +25,7 @@
> # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
> AM_CFLAGS = @XMODES_CFLAGS@ @XORG_CFLAGS@ $(LIBDRM_CFLAGS)
> nv_drv_la_LTLIBRARIES = nv_drv.la
> -nv_drv_la_LDFLAGS = -module -avoid-version
> +nv_drv_la_LDFLAGS = -module -avoid-version $(LIBDRM_LIBS)
> nv_drv_ladir = @moduledir@/drivers
>
> nv_drv_la_SOURCES = $(nv_sources) $(riva_sources) $(g80_sources)
> diff --git a/src/nv_driver.c b/src/nv_driver.c
> index e10ae0c..6651cd4 100644
> --- a/src/nv_driver.c
> +++ b/src/nv_driver.c
> @@ -836,18 +836,13 @@ NVIsSupported(CARD32 id)
> }
>
> #ifdef HAVE_KMS
> -static Bool NVKernelModesettingEnabled(struct pci_device *device)
> +static Bool NVKernelModesettingEnabled(struct pci_device *dev)
> {
> - char *busIdString;
> + char busIdString[20];
> int ret;
>
> - if (!xf86LoaderCheckSymbol("DRICreatePCIBusID"))
> - return FALSE;
> -
> - busIdString = DRICreatePCIBusID(device);
> -
> + snprintf(busIdString, 20, "pci:%04x:%02x:%02x.%d", dev->domain, dev->bus, dev->dev, dev->func);
> ret = drmCheckModesettingSupported(busIdString);
> - xfree(busIdString);
>
> return (ret == 0);
> }
next prev parent reply other threads:[~2010-05-23 22:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-23 19:46 [PATCH] nv: improve KMS detection Marcin Slusarz
[not found] ` <20100523194645.GA15846-OI9uyE9O0yo@public.gmane.org>
2010-05-23 22:37 ` Ben Skeggs [this message]
2010-05-28 18:45 ` Aaron Plattner
[not found] ` <20100528184517.GA12408-J3EY2hv0KmgMOYszX5p1ytBPR1lH4CV8@public.gmane.org>
2010-06-02 16:20 ` Marcin Slusarz
[not found] ` <20100602162047.GA2973-OI9uyE9O0yo@public.gmane.org>
2010-06-02 19:07 ` Aaron Plattner
[not found] ` <20100602190752.GA17877-J3EY2hv0KmgMOYszX5p1ytBPR1lH4CV8@public.gmane.org>
2010-06-02 22:19 ` Ben Skeggs
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=1274654223.7344.0.camel@nisroch \
--to=skeggsb-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=aplattner-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org \
--cc=marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=raof-GeWIH/nMZzLQT0dZR+AlfA@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.