From patchwork Tue Mar 29 16:44:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 671712 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p2TGjH6A007362 for ; Tue, 29 Mar 2011 16:45:38 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 82B4A9ED8C for ; Tue, 29 Mar 2011 09:45:17 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gx0-f177.google.com (mail-gx0-f177.google.com [209.85.161.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 465AA9E79E for ; Tue, 29 Mar 2011 09:45:07 -0700 (PDT) Received: by gxk2 with SMTP id 2so166273gxk.36 for ; Tue, 29 Mar 2011 09:45:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:sender:from:to:cc:subject:date:message-id :x-mailer; bh=f/vd74zxj4EEHDBVhB8zO02l374w2N7KYpV0xeBbrnU=; b=ujYJ5gIr5Qd8wDkAfV1APpvJ/5f1bMxHLFMkxg90FOHTbo1xPuHsJH927YIxqqArDC nMRCsLH1AABplXpRJXHi99r9N+g+3FwfXWmJkjlAIxNq955o+Au1f134ixjUZR2V6vzn 0gej/PV7RDLtBkPHO65X4SEt5mSn0zvpfduQg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer; b=YqUnA0yOVudujLpf6baRvB5OhdnjxDAV18rfRHWGTCjGybyMkU0W1Ot9cRLwc2OSJj WjDqF8KPn/iHsK4Fwsl0JVvZCxVT1snKzM54XgbTB8BIVHAqVj+NA4cpQUsjE2dNvuqh APIhci4AAZnggRilS33m0JSZTfiQ1VY5LHf7I= Received: by 10.236.161.228 with SMTP id w64mr11210yhk.23.1301417106323; Tue, 29 Mar 2011 09:45:06 -0700 (PDT) Received: from localhost (dragon.ti.com [192.94.94.33]) by mx.google.com with ESMTPS id l29sm2542405yhn.32.2011.03.29.09.45.04 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 29 Mar 2011 09:45:05 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Subject: [RFC] drm platform multi-device support Date: Tue, 29 Mar 2011 11:44:53 -0500 Message-Id: <1301417093-14843-1-git-send-email-rob@ti.com> X-Mailer: git-send-email 1.7.1 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 (demeter1.kernel.org [140.211.167.41]); Tue, 29 Mar 2011 16:45:38 +0000 (UTC) diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c index 47db4df..075024b 100644 --- a/drivers/gpu/drm/drm_ioctl.c +++ b/drivers/gpu/drm/drm_ioctl.c @@ -165,14 +165,15 @@ static int drm_set_busid(struct drm_device *dev, struct drm_file *file_priv) drm_unset_busid(dev, master); if (drm_core_check_feature(dev, DRIVER_USE_PLATFORM_DEVICE)) { - 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->primary->index); if (len > master->unique_len) { DRM_ERROR("Unique buffer overflowed\n");