[RFC] drm platform multi-device support
Ilija Hadzic
ihadzic at research.bell-labs.com
Wed Mar 30 05:57:17 PDT 2011
Are you by any chance working off a stale branch in git ?
Apparently the lines you are modifying now live in drm_platform_set_busid
function in drm_platform.c
-- Ilija
On Tue, 29 Mar 2011, Rob Clark wrote:
> From: Rob Clark <robdclark at gmail.com>
>
> Include the minor device id in the bus-id to give userspace a way to open
> the correct "cardN" when there are multiple device instances.
> ---
> It may seem a bit strange to have multiple platform device instances, but
> we have a use-case for this. And this relatively simple patch does the
> trick.
>
> drivers/gpu/drm/drm_ioctl.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> 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");
> --
> 1.7.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>
More information about the dri-devel
mailing list