[PATCH 5/5] drm/amdgpu/codec: drop the internal codec index
Alex Deucher
alexdeucher at gmail.com
Tue Feb 2 16:13:03 UTC 2021
And just use the ioctl index. They are the same.
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu.h | 9 -----
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 16 ++++-----
drivers/gpu/drm/amd/amdgpu/cik.c | 12 ++++---
drivers/gpu/drm/amd/amdgpu/nv.c | 36 ++++++++++---------
drivers/gpu/drm/amd/amdgpu/si.c | 12 ++++---
drivers/gpu/drm/amd/amdgpu/soc15.c | 46 +++++++++++++------------
drivers/gpu/drm/amd/amdgpu/vi.c | 28 ++++++++-------
7 files changed, 80 insertions(+), 79 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 4e4da872273f..fdfa88c7b171 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -582,15 +582,6 @@ enum amd_reset_method {
AMD_RESET_METHOD_BACO
};
-#define AMDGPU_VIDEO_CODEC_TYPE_MPEG2 0
-#define AMDGPU_VIDEO_CODEC_TYPE_MPEG4 1
-#define AMDGPU_VIDEO_CODEC_TYPE_VC1 2
-#define AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC 3
-#define AMDGPU_VIDEO_CODEC_TYPE_HEVC 4
-#define AMDGPU_VIDEO_CODEC_TYPE_JPEG 5
-#define AMDGPU_VIDEO_CODEC_TYPE_VP9 6
-#define AMDGPU_VIDEO_CODEC_TYPE_AV1 7
-
struct amdgpu_video_codec_info {
u32 codec_type;
u32 max_width;
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index 04b9cd75f7b4..b78847fa769b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -1019,14 +1019,14 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
int idx = codecs->codec_array[i].codec_type;
switch (idx) {
- case AMDGPU_VIDEO_CODEC_TYPE_MPEG2:
- case AMDGPU_VIDEO_CODEC_TYPE_MPEG4:
- case AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC:
- case AMDGPU_VIDEO_CODEC_TYPE_VC1:
- case AMDGPU_VIDEO_CODEC_TYPE_HEVC:
- case AMDGPU_VIDEO_CODEC_TYPE_JPEG:
- case AMDGPU_VIDEO_CODEC_TYPE_VP9:
- case AMDGPU_VIDEO_CODEC_TYPE_AV1:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9:
+ case AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1:
caps->codec_info[idx].valid = 1;
caps->codec_info[idx].max_width =
codecs->codec_array[i].max_width;
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c
index 12ed86deaa84..6ee2c0e3ea50 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik.c
@@ -26,6 +26,8 @@
#include <linux/module.h>
#include <linux/pci.h>
+#include <drm/amdgpu_drm.h>
+
#include "amdgpu.h"
#include "amdgpu_atombios.h"
#include "amdgpu_ih.h"
@@ -73,7 +75,7 @@
static const struct amdgpu_video_codec_info cik_video_codecs_encode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
@@ -90,28 +92,28 @@ static const struct amdgpu_video_codecs cik_video_codecs_encode =
static const struct amdgpu_video_codec_info cik_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
.max_level = 41,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
diff --git a/drivers/gpu/drm/amd/amdgpu/nv.c b/drivers/gpu/drm/amd/amdgpu/nv.c
index 64c973cd9088..e6878645df93 100644
--- a/drivers/gpu/drm/amd/amdgpu/nv.c
+++ b/drivers/gpu/drm/amd/amdgpu/nv.c
@@ -25,6 +25,8 @@
#include <linux/module.h>
#include <linux/pci.h>
+#include <drm/amdgpu_drm.h>
+
#include "amdgpu.h"
#include "amdgpu_atombios.h"
#include "amdgpu_ih.h"
@@ -68,14 +70,14 @@ static const struct amd_ip_funcs nv_common_ip_funcs;
static const struct amdgpu_video_codec_info nv_video_codecs_encode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
@@ -93,49 +95,49 @@ static const struct amdgpu_video_codecs nv_video_codecs_encode =
static const struct amdgpu_video_codec_info nv_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 4,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 8192 * 4352,
.max_level = 186,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_JPEG,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VP9,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 8192 * 4352,
@@ -153,56 +155,56 @@ static const struct amdgpu_video_codecs nv_video_codecs_decode =
static const struct amdgpu_video_codec_info sc_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 4,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 8192 * 4352,
.max_level = 186,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_JPEG,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VP9,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 8192 * 4352,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_AV1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_AV1,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 8192 * 4352,
diff --git a/drivers/gpu/drm/amd/amdgpu/si.c b/drivers/gpu/drm/amd/amdgpu/si.c
index da258ff75042..7817e5156cb5 100644
--- a/drivers/gpu/drm/amd/amdgpu/si.c
+++ b/drivers/gpu/drm/amd/amdgpu/si.c
@@ -26,6 +26,8 @@
#include <linux/module.h>
#include <linux/pci.h>
+#include <drm/amdgpu_drm.h>
+
#include "amdgpu.h"
#include "amdgpu_atombios.h"
#include "amdgpu_ih.h"
@@ -911,7 +913,7 @@ static const u32 hainan_mgcg_cgcg_init[] =
static const struct amdgpu_video_codec_info tahiti_video_codecs_encode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
@@ -942,28 +944,28 @@ static const struct amdgpu_video_codecs hainan_video_codecs_encode =
static const struct amdgpu_video_codec_info tahiti_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
.max_level = 41,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 2048,
.max_height = 1152,
.max_pixels_per_frame = 2048 * 1152,
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
index a81fd7de72b7..5ef2e2707754 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -25,6 +25,8 @@
#include <linux/module.h>
#include <linux/pci.h>
+#include <drm/amdgpu_drm.h>
+
#include "amdgpu.h"
#include "amdgpu_atombios.h"
#include "amdgpu_ih.h"
@@ -87,14 +89,14 @@
static const struct amdgpu_video_codec_info vega_video_codecs_encode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
@@ -112,42 +114,42 @@ static const struct amdgpu_video_codecs vega_video_codecs_encode =
static const struct amdgpu_video_codec_info vega_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 4,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 186,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_JPEG,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
@@ -165,49 +167,49 @@ static const struct amdgpu_video_codecs vega_video_codecs_decode =
static const struct amdgpu_video_codec_info rv_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 4,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 186,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_JPEG,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VP9,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
@@ -225,49 +227,49 @@ static const struct amdgpu_video_codecs rv_video_codecs_decode =
static const struct amdgpu_video_codec_info rn_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 4,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 186,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_JPEG,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VP9,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VP9,
.max_width = 8192,
.max_height = 4352,
.max_pixels_per_frame = 4096 * 4096,
diff --git a/drivers/gpu/drm/amd/amdgpu/vi.c b/drivers/gpu/drm/amd/amdgpu/vi.c
index 462368d2804b..2bfead243335 100644
--- a/drivers/gpu/drm/amd/amdgpu/vi.c
+++ b/drivers/gpu/drm/amd/amdgpu/vi.c
@@ -24,6 +24,8 @@
#include <linux/pci.h>
#include <linux/slab.h>
+#include <drm/amdgpu_drm.h>
+
#include "amdgpu.h"
#include "amdgpu_atombios.h"
#include "amdgpu_ih.h"
@@ -90,7 +92,7 @@ static const struct amdgpu_video_codecs topaz_video_codecs_encode =
static const struct amdgpu_video_codec_info tonga_video_codecs_encode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
@@ -108,14 +110,14 @@ static const struct amdgpu_video_codecs tonga_video_codecs_encode =
static const struct amdgpu_video_codec_info polaris_video_codecs_encode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
.max_level = 0,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 4096,
.max_height = 2304,
.max_pixels_per_frame = 4096 * 2304,
@@ -140,28 +142,28 @@ static const struct amdgpu_video_codecs topaz_video_codecs_decode =
static const struct amdgpu_video_codec_info tonga_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
@@ -179,42 +181,42 @@ static const struct amdgpu_video_codecs tonga_video_codecs_decode =
static const struct amdgpu_video_codec_info cz_video_codecs_decode_array[] =
{
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG2,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG2,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 3,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 5,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_MPEG4_AVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_MPEG4_AVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 52,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_VC1,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_VC1,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 4,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_HEVC,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_HEVC,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
.max_level = 186,
},
{
- .codec_type = AMDGPU_VIDEO_CODEC_TYPE_JPEG,
+ .codec_type = AMDGPU_INFO_VIDEO_CAPS_CODEC_IDX_JPEG,
.max_width = 4096,
.max_height = 4096,
.max_pixels_per_frame = 4096 * 4096,
--
2.29.2
More information about the amd-gfx
mailing list