From patchwork Thu Jul 14 03:12:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 974002 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6E3D0Yn007027 for ; Thu, 14 Jul 2011 03:13:22 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 201369E925 for ; Wed, 13 Jul 2011 20:13:00 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by gabe.freedesktop.org (Postfix) with ESMTP id D249A9E811 for ; Wed, 13 Jul 2011 20:12:50 -0700 (PDT) Received: by yxj20 with SMTP id 20so3106433yxj.36 for ; Wed, 13 Jul 2011 20:12:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=87N0+OA2HZE9PO+WyHF0k3oieCWtHQPxHW3Wu9eyNb0=; b=Yy71CSOMe9IvaElFG/br1izHzz5+5oM5db6dIBnzXB7bfk4vutVn8fv0APmTD6DgzA oOC3v1bLhzMRQRIpabTu1dzb5qBD7ehiYqWUfj7SAaMqtsTEhYeP3PQJefM3RhE5339D 0WbRNwvd8KINXFxyELvKP+/jx0k1XBkTb7BY0= Received: by 10.150.66.20 with SMTP id o20mr1844516yba.344.1310613170224; Wed, 13 Jul 2011 20:12:50 -0700 (PDT) Received: from localhost (ppp-70-129-137-212.dsl.rcsntx.swbell.net [70.129.137.212]) by mx.google.com with ESMTPS id c69sm2145028yhm.57.2011.07.13.20.12.47 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 13 Jul 2011 20:12:49 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: platform multi-device support Date: Wed, 13 Jul 2011 22:12:43 -0500 Message-Id: <1310613163-4284-1-git-send-email-rob@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1301417093-14843-1-git-send-email-rob@ti.com> References: <1301417093-14843-1-git-send-email-rob@ti.com> Cc: Rob Clark X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 14 Jul 2011 03:13:22 +0000 (UTC) Include the device id in the bus-id to give userspace a way to open the correct "cardN" when there are multiple device instances. Signed-off-by: Rob Clark --- drivers/gpu/drm/drm_platform.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c index 7223f06..2a8b626 100644 --- a/drivers/gpu/drm/drm_platform.c +++ b/drivers/gpu/drm/drm_platform.c @@ -123,14 +123,15 @@ static int drm_platform_set_busid(struct drm_device *dev, struct drm_master *mas { int len, ret; - master->unique_len = 10 + strlen(dev->platformdev->name); + master->unique_len = 13 + strlen(dev->platformdev->name); + master->unique_size = master->unique_len; master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL); if (master->unique == NULL) return -ENOMEM; len = snprintf(master->unique, master->unique_len, - "platform:%s", dev->platformdev->name); + "platform:%s:%02d", dev->platformdev->name, dev->platformdev->id); if (len > master->unique_len) { DRM_ERROR("Unique buffer overflowed\n");