Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/tegra: Allocate per-engine channel in core code

To avoid code duplication, allocate the per-engine shared channel in
the core code instead. This is the usual channel that all jobs are
submitted to when MLOCKing is not in use. Once MLOCKs are implemented
on Host1x side, we can also update this to avoid allocating a shared
channel when MLOCKs are enabled.

Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Mikko Perttunen and committed by
Thierry Reding
e0f2977c 99166123

+13
+11
drivers/gpu/drm/tegra/drm.c
··· 870 870 int tegra_drm_register_client(struct tegra_drm *tegra, 871 871 struct tegra_drm_client *client) 872 872 { 873 + /* 874 + * When MLOCKs are implemented, change to allocate a shared channel 875 + * only when MLOCKs are disabled. 876 + */ 877 + client->shared_channel = host1x_channel_request(&client->base); 878 + if (!client->shared_channel) 879 + return -EBUSY; 880 + 873 881 mutex_lock(&tegra->clients_lock); 874 882 list_add_tail(&client->list, &tegra->clients); 875 883 client->drm = tegra; ··· 893 885 list_del_init(&client->list); 894 886 client->drm = NULL; 895 887 mutex_unlock(&tegra->clients_lock); 888 + 889 + if (client->shared_channel) 890 + host1x_channel_put(client->shared_channel); 896 891 897 892 return 0; 898 893 }
+2
drivers/gpu/drm/tegra/drm.h
··· 91 91 struct host1x_client base; 92 92 struct list_head list; 93 93 struct tegra_drm *drm; 94 + struct host1x_channel *shared_channel; 94 95 96 + /* Set by driver */ 95 97 unsigned int version; 96 98 const struct tegra_drm_client_ops *ops; 97 99 };