From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Herrmann Subject: [PATCH 00/13] DRM Reliable Minor-IDs Date: Wed, 29 Jan 2014 15:01:47 +0100 Message-ID: <1391004120-687-1-git-send-email-dh.herrmann@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ea0-f171.google.com (mail-ea0-f171.google.com [209.85.215.171]) by gabe.freedesktop.org (Postfix) with ESMTP id A81FD436E8 for ; Wed, 29 Jan 2014 06:02:14 -0800 (PST) Received: by mail-ea0-f171.google.com with SMTP id f15so939460eak.16 for ; Wed, 29 Jan 2014 06:02:12 -0800 (PST) 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: dri-devel@lists.freedesktop.org Cc: Daniel Vetter List-Id: dri-devel@lists.freedesktop.org Hi I was looking into our minor-allocation code and it has one major drawback: char-dev minor-IDs are unreliable. The +128 hacks we use in user-space to calculate render-node IDs based on the original card just does not work. Instead of allocating dummy IDs for each driver, I went ahead and tried to fix it properly. So this series changes the minor-ID management to just allocate a single dev->minor_base ID instead of one ID per "drm_minor". Now we can use this base to calculate the correct offset minor-ID for each existing DRM-minor. While at it, I introduced drm-refcounts to make minor-lookup independent of drm_global_mutex. This is still not finished (and dev->open_count still exists) but I already have the next patches waiting here. Comments welcome! Branch is also available here: http://cgit.freedesktop.org/~dvdhrm/linux/log/?h=minor If someone could pull this into their tree and push to Fengguang's test-framework, I'd appreciate it a lot! I'm still waiting for a reply from him. Thanks David David Herrmann (13): drm: group dev-lifetime related members drm: skip redundant minor-lookup in open path drm: remove unused DRM_MINOR_UNASSIGNED drm: turn DRM_MINOR_* into enum drm: provide device-refcount drm: add minor-lookup/release helpers drm: allocate minors early drm: move drm_put_minor() to drm_minor_free() drm: rename drm_unplug/get_minor() to drm_minor_register/unregister() drm: remove unneeded #ifdef CONFIG_DEBUGFS drm: remove redundant minor->device field drm: make minor-IDs reliable drm: remove redundant minor->index drivers/gpu/drm/drm_drv.c | 4 +- drivers/gpu/drm/drm_fops.c | 74 ++--- drivers/gpu/drm/drm_info.c | 2 +- drivers/gpu/drm/drm_pci.c | 4 +- drivers/gpu/drm/drm_platform.c | 4 +- drivers/gpu/drm/drm_stub.c | 418 ++++++++++++++++-------- drivers/gpu/drm/drm_sysfs.c | 8 +- drivers/gpu/drm/drm_usb.c | 4 +- drivers/gpu/drm/i915/i915_gpu_error.c | 2 +- drivers/gpu/drm/i915/i915_trace.h | 20 +- drivers/gpu/drm/msm/msm_fbdev.c | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 2 +- drivers/gpu/drm/radeon/atombios_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_legacy_encoders.c | 2 +- drivers/gpu/drm/radeon/radeon_trace.h | 2 +- drivers/gpu/drm/tegra/bus.c | 4 +- include/drm/drmP.h | 44 ++- 17 files changed, 382 insertions(+), 216 deletions(-) -- 1.8.5.3