public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm: drm: tegra: Set MODULE_FIRMWARE for the VIC
@ 2017-07-05 21:15 Nicolas Chauvet
       [not found] ` <20170705211523.17542-1-kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Chauvet @ 2017-07-05 21:15 UTC (permalink / raw)
  To: amerilainen-DDmLM1+adcrQT0dZR+AlfA,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w,
	mperttunen-DDmLM1+adcrQT0dZR+AlfA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, 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")

Signed-off-by: Nicolas Chauvet <kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index cd804e404a11..b329c9368b74 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -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[] = {
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: drm: tegra: Set MODULE_FIRMWARE for the VIC
       [not found] ` <20170705211523.17542-1-kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-07-10  8:57   ` Mikko Perttunen
  0 siblings, 0 replies; 4+ messages in thread
From: Mikko Perttunen @ 2017-07-10  8:57 UTC (permalink / raw)
  To: Nicolas Chauvet, amerilainen-DDmLM1+adcrQT0dZR+AlfA,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w,
	mperttunen-DDmLM1+adcrQT0dZR+AlfA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 06.07.2017 00:15, Nicolas Chauvet wrote:
> 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")
>
> Signed-off-by: Nicolas Chauvet <kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> ---
>  drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
> index cd804e404a11..b329c9368b74 100644
> --- a/drivers/gpu/drm/tegra/vic.c
> +++ b/drivers/gpu/drm/tegra/vic.c
> @@ -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
> +
> +

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,

Reviewed-by: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

>  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[] = {
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] arm: drm: tegra: Set MODULE_FIRMWARE for the VIC
@ 2017-07-11  8:39 Nicolas Chauvet
       [not found] ` <20170711083904.6969-1-kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Chauvet @ 2017-07-11  8:39 UTC (permalink / raw)
  To: amerilainen-DDmLM1+adcrQT0dZR+AlfA,
	thierry.reding-Re5JQEeQqe8AvxtiuMwx3w,
	mperttunen-DDmLM1+adcrQT0dZR+AlfA
  Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Nicolas Chauvet

The defines are 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")

v2:
 - Place the defines above each chip's vic_config struct
 - MODULE_FIRMWARE() at the end of the file

Signed-off-by: Nicolas Chauvet <kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/tegra/vic.c b/drivers/gpu/drm/tegra/vic.c
index cd804e404a11..819e485fde72 100644
--- a/drivers/gpu/drm/tegra/vic.c
+++ b/drivers/gpu/drm/tegra/vic.c
@@ -258,12 +258,16 @@ static const struct tegra_drm_client_ops vic_ops = {
 	.submit = tegra_drm_submit,
 };
 
+#define NVIDIA_TEGRA_124_VIC_FIRMWARE "nvidia/tegra124/vic03_ucode.bin"
+
 static const struct vic_config vic_t124_config = {
-	.firmware = "nvidia/tegra124/vic03_ucode.bin",
+	.firmware = NVIDIA_TEGRA_124_VIC_FIRMWARE,
 };
 
+#define NVIDIA_TEGRA_210_VIC_FIRMWARE "nvidia/tegra210/vic04_ucode.bin"
+
 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[] = {
@@ -394,3 +398,10 @@ struct platform_driver tegra_vic_driver = {
 	.probe = vic_probe,
 	.remove = vic_remove,
 };
+
+#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
-- 
2.13.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] arm: drm: tegra: Set MODULE_FIRMWARE for the VIC
       [not found] ` <20170711083904.6969-1-kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2017-08-17 15:23   ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2017-08-17 15:23 UTC (permalink / raw)
  To: Nicolas Chauvet
  Cc: amerilainen-DDmLM1+adcrQT0dZR+AlfA,
	mperttunen-DDmLM1+adcrQT0dZR+AlfA,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

On Tue, Jul 11, 2017 at 10:39:04AM +0200, Nicolas Chauvet wrote:
> The defines are 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")
> 
> v2:
>  - Place the defines above each chip's vic_config struct
>  - MODULE_FIRMWARE() at the end of the file
> 
> Signed-off-by: Nicolas Chauvet <kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Mikko Perttunen <mperttunen-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
> ---
>  drivers/gpu/drm/tegra/vic.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)

Applied, thanks!

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-08-17 15:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-11  8:39 [PATCH] arm: drm: tegra: Set MODULE_FIRMWARE for the VIC Nicolas Chauvet
     [not found] ` <20170711083904.6969-1-kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-08-17 15:23   ` Thierry Reding
  -- strict thread matches above, loose matches on Subject: below --
2017-07-05 21:15 Nicolas Chauvet
     [not found] ` <20170705211523.17542-1-kwizart-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-07-10  8:57   ` Mikko Perttunen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox