[Nouveau] [PATCH 3/5] falcon: use the nvkm_firmware functions
Alexandre Courbot
acourbot at nvidia.com
Sun Jan 17 22:07:11 PST 2016
Use the newly-introduced nvkm_firmware functions. Note that this will
change the expected location of firmware files.
Signed-off-by: Alexandre Courbot <acourbot at nvidia.com>
---
drm/nouveau/nvkm/engine/falcon.c | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drm/nouveau/nvkm/engine/falcon.c b/drm/nouveau/nvkm/engine/falcon.c
index 74000602fbb1..028113c6f82d 100644
--- a/drm/nouveau/nvkm/engine/falcon.c
+++ b/drm/nouveau/nvkm/engine/falcon.c
@@ -22,6 +22,7 @@
#include <engine/falcon.h>
#include <core/gpuobj.h>
+#include <core/firmware.h>
#include <subdev/timer.h>
#include <engine/fifo.h>
@@ -187,16 +188,15 @@ nvkm_falcon_init(struct nvkm_engine *engine)
* locate a "self-bootstrapping" firmware image for the engine
*/
if (!falcon->code.data) {
- snprintf(name, sizeof(name), "nouveau/nv%02x_fuc%03x",
- device->chipset, falcon->addr >> 12);
+ snprintf(name, sizeof(name), "fuc%03x", falcon->addr >> 12);
- ret = request_firmware(&fw, name, device->dev);
+ ret = nvkm_firmware_get(device, name, &fw);
if (ret == 0) {
falcon->code.data = vmemdup(fw->data, fw->size);
falcon->code.size = fw->size;
falcon->data.data = NULL;
falcon->data.size = 0;
- release_firmware(fw);
+ nvkm_firmware_put(fw);
}
falcon->external = true;
@@ -206,10 +206,9 @@ nvkm_falcon_init(struct nvkm_engine *engine)
* images for the engine
*/
if (!falcon->code.data) {
- snprintf(name, sizeof(name), "nouveau/nv%02x_fuc%03xd",
- device->chipset, falcon->addr >> 12);
+ snprintf(name, sizeof(name), "fuc%03xd", falcon->addr >> 12);
- ret = request_firmware(&fw, name, device->dev);
+ ret = nvkm_firmware_get(device, name, &fw);
if (ret) {
nvkm_error(subdev, "unable to load firmware data\n");
return -ENODEV;
@@ -217,14 +216,13 @@ nvkm_falcon_init(struct nvkm_engine *engine)
falcon->data.data = vmemdup(fw->data, fw->size);
falcon->data.size = fw->size;
- release_firmware(fw);
+ nvkm_firmware_put(fw);
if (!falcon->data.data)
return -ENOMEM;
- snprintf(name, sizeof(name), "nouveau/nv%02x_fuc%03xc",
- device->chipset, falcon->addr >> 12);
+ snprintf(name, sizeof(name), "fuc%03xc", falcon->addr >> 12);
- ret = request_firmware(&fw, name, device->dev);
+ ret = nvkm_firmware_get(device, name, &fw);
if (ret) {
nvkm_error(subdev, "unable to load firmware code\n");
return -ENODEV;
@@ -232,7 +230,7 @@ nvkm_falcon_init(struct nvkm_engine *engine)
falcon->code.data = vmemdup(fw->data, fw->size);
falcon->code.size = fw->size;
- release_firmware(fw);
+ nvkm_firmware_put(fw);
if (!falcon->code.data)
return -ENOMEM;
}
--
2.7.0
More information about the Nouveau
mailing list