diff options
author | Rob Clark <rob@ti.com> | 2011-07-14 03:12:43 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-07-15 06:52:58 +0100 |
commit | 28a4a163b561c39ac0c798d420e0927f29e9d4c8 (patch) | |
tree | 37aa3c8b3a05e55bbfe2d61fd43a7500d1993adf /drivers/gpu | |
parent | d0254d56c72532b5d818d83c5e247fc627803f08 (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')
-rw-r--r-- | 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 7223f06d8e5..2a8b6265ad3 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"); |