Skip to content

Commit

Permalink
drm: platform multi-device support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rob Clark authored and Dave Airlie committed Jul 15, 2011
1 parent d0254d5 commit 28a4a16
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/gpu/drm/drm_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 28a4a16

Please sign in to comment.