aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_platform.c
diff options
context:
space:
mode:
authorRob Clark <rob@ti.com>2011-07-13 23:12:43 -0400
committerDave Airlie <airlied@redhat.com>2011-07-15 01:52:58 -0400
commit28a4a163b561c39ac0c798d420e0927f29e9d4c8 (patch)
tree37aa3c8b3a05e55bbfe2d61fd43a7500d1993adf /drivers/gpu/drm/drm_platform.c
parentd0254d56c72532b5d818d83c5e247fc627803f08 (diff)
drm: platform multi-device support
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 <rob@ti.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/drm_platform.c')
-rw-r--r--drivers/gpu/drm/drm_platform.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c
index 7223f06d8e58..2a8b6265ad3d 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
123{ 123{
124 int len, ret; 124 int len, ret;
125 125
126 master->unique_len = 10 + strlen(dev->platformdev->name); 126 master->unique_len = 13 + strlen(dev->platformdev->name);
127 master->unique_size = master->unique_len;
127 master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL); 128 master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL);
128 129
129 if (master->unique == NULL) 130 if (master->unique == NULL)
130 return -ENOMEM; 131 return -ENOMEM;
131 132
132 len = snprintf(master->unique, master->unique_len, 133 len = snprintf(master->unique, master->unique_len,
133 "platform:%s", dev->platformdev->name); 134 "platform:%s:%02d", dev->platformdev->name, dev->platformdev->id);
134 135
135 if (len > master->unique_len) { 136 if (len > master->unique_len) {
136 DRM_ERROR("Unique buffer overflowed\n"); 137 DRM_ERROR("Unique buffer overflowed\n");