From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Jackson Subject: Re: [PATCH 4/5] drm/vgem: getparam ioctl Date: Wed, 15 Feb 2012 16:22:10 -0500 Message-ID: <4F3C2202.2050708@redhat.com> References: <1328743171-13750-1-git-send-email-ben@bwidawsk.net> <1328743171-13750-5-git-send-email-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id AEBD39E7A8 for ; Wed, 15 Feb 2012 13:22:13 -0800 (PST) In-Reply-To: <1328743171-13750-5-git-send-email-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On 2/8/12 6:19 PM, Ben Widawsky wrote: > Similar to i915, it's nice to be able to query this device uniquely and > get some info > > Signed-off-by: Ben Widawsky So, this is actually not especially useful as written. You'd like to be able to use this to find the vgem device node, but since it's a device-specific ioctl it collides with whatever happens to be device-specific ioctl number 2 on whatever device you've opened. On i915, that's I915_FLIP, and you promptly oops the machine. Comedy. Gold. Which is fine, really. The way I was anticipating finding the vgem node was to just scrape the device node name out of /sys/bus/platform/devices/vgem/cardN, because why do anything O(n) when you could do it O(1). I guess that doesn't help OSes that aren't Linux, and I guess if pressed to care about that I'd say hang it off drm_getcap. - ajax