Skip to contentSkip to conversation

arm: drm: tegra: Set MODULE_FIRMWARE for the VIC

PATCH In review Nicolas Chauvet 2 participants 2 messages Jul 5, 2017 – Jul 10, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: drm: tegra: Set MODULE_FIRMWARE for the VIC

The define is set anyway to prevent an empty string. The test for the soc is same as nouveau for the tegra gpu firmware (see drivers/gpu/drm/nouveau/nouveau_platform.c)

Fixes 0ae797a8ba05 ("drm/tegra: Add VIC support")
---
 drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/tegra/vic.c +13 -2
index cd804e404a11..b329c9368b74 100644
@@ -23,6 +23,17 @@
 #include "falcon.h"
 #include "vic.h"
 
+#define NVIDIA_TEGRA_124_VIC_FIRMWARE "nvidia/tegra124/vic03_ucode.bin"
+#define NVIDIA_TEGRA_210_VIC_FIRMWARE "nvidia/tegra210/vic04_ucode.bin"
+
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC)
+MODULE_FIRMWARE(NVIDIA_TEGRA_124_VIC_FIRMWARE);
+#endif
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
+MODULE_FIRMWARE(NVIDIA_TEGRA_210_VIC_FIRMWARE);
+#endif
+
+
 struct vic_config {
 	const char *firmware;
 };
@@ -259,11 +270,11 @@ static const struct tegra_drm_client_ops vic_ops = {
 };
 
 static const struct vic_config vic_t124_config = {
-	.firmware = "nvidia/tegra124/vic03_ucode.bin",
+	.firmware = NVIDIA_TEGRA_124_VIC_FIRMWARE,
 };
 
 static const struct vic_config vic_t210_config = {
-	.firmware = "nvidia/tegra210/vic04_ucode.bin",
+	.firmware = NVIDIA_TEGRA_210_VIC_FIRMWARE,
 };
 
 static const struct of_device_id vic_match[] = {
Signature · 1 line
2.13.0
Reviewed-by
#2 lore raw
In reply to a message not in the archive
Quoted 20 lines · Nicolas Chauvet

The define is set anyway to prevent an empty string. The test for the soc is same as nouveau for the tegra gpu firmware (see drivers/gpu/drm/nouveau/nouveau_platform.c)

Fixes 0ae797a8ba05 ("drm/tegra: Add VIC support")
---
 drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/tegra/vic.c +1 -0
index cd804e404a11..b329c9368b74 100644
@@ -23,6 +23,17 @@
 #include "falcon.h"
 #include "vic.h"
 
+#define NVIDIA_TEGRA_124_VIC_FIRMWARE "nvidia/tegra124/vic03_ucode.bin"

drivers/gpu/drm/tegra/vic.c line 36

Quoted 10 lines
drivers/gpu/drm/tegra/vic.c +10 -0
+#define NVIDIA_TEGRA_210_VIC_FIRMWARE "nvidia/tegra210/vic04_ucode.bin"
+
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_124_SOC)
+MODULE_FIRMWARE(NVIDIA_TEGRA_124_VIC_FIRMWARE);
+#endif
+#if IS_ENABLED(CONFIG_ARCH_TEGRA_210_SOC)
+MODULE_FIRMWARE(NVIDIA_TEGRA_210_VIC_FIRMWARE);
+#endif
+
+

I'd prefer to have the defines above each chip's vic_config struct definition, and the MODULE_FIRMWARE() part at the end of the file, like MODULE_* macros usually are. With that,

Quoted 18 lines
drivers/gpu/drm/tegra/vic.c +2 -2
 struct vic_config {
 	const char *firmware;
 };
@@ -259,11 +270,11 @@ static const struct tegra_drm_client_ops vic_ops = {
 };
 
 static const struct vic_config vic_t124_config = {
-	.firmware = "nvidia/tegra124/vic03_ucode.bin",
+	.firmware = NVIDIA_TEGRA_124_VIC_FIRMWARE,
 };
 
 static const struct vic_config vic_t210_config = {
-	.firmware = "nvidia/tegra210/vic04_ucode.bin",
+	.firmware = NVIDIA_TEGRA_210_VIC_FIRMWARE,
 };
 
 static const struct of_device_id vic_match[] = {