summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlibs/device-2d/imx_2d_device_pxp.c28
-rwxr-xr-xlibs/gstimxcommon.c36
-rwxr-xr-xlibs/gstimxcommon.h3
3 files changed, 19 insertions, 48 deletions
diff --git a/libs/device-2d/imx_2d_device_pxp.c b/libs/device-2d/imx_2d_device_pxp.c
index 7e3ec3e..99378a9 100755
--- a/libs/device-2d/imx_2d_device_pxp.c
+++ b/libs/device-2d/imx_2d_device_pxp.c
@@ -293,19 +293,7 @@ static gint imx_pxp_config_input(Imx2DDevice *device, Imx2DVideoInfo* in_info)
pxp->config.s0_param.pixel_fmt = in_map->pxp_format;
pxp->config.s0_param.width = in_info->w;
pxp->config.s0_param.height = in_info->h;
-
- int kv = get_kernel_version();
- if (kv < 0) {
- GST_ERROR ("get kernel version failed");
- return -1;
- }
-
- /* on 4.9.11 kernel or later, we need pass the actual stride
- * to pxp driver */
- if (kv < KERN_VER(4,9,11))
- pxp->config.s0_param.stride = in_info->w;
- else
- pxp->config.s0_param.stride = in_info->stride;
+ pxp->config.s0_param.stride = in_info->w;
GST_TRACE("input format = %s", gst_video_format_to_string(in_info->fmt));
@@ -331,19 +319,7 @@ static gint imx_pxp_config_output(Imx2DDevice *device, Imx2DVideoInfo* out_info)
pxp->config.out_param.pixel_fmt = out_map->pxp_format;
pxp->config.out_param.width = out_info->w;
pxp->config.out_param.height = out_info->h;
-
- int kv = get_kernel_version();
- if (kv < 0) {
- GST_ERROR ("get kernel version failed");
- return -1;
- }
-
- /* on 4.9.11 kernel or later, we need pass the actual stride
- * to pxp driver */
- if (kv < KERN_VER(4,9,11))
- pxp->config.out_param.stride = out_info->w;
- else
- pxp->config.out_param.stride = out_info->stride;
+ pxp->config.out_param.stride = out_info->w;
GST_TRACE("output format = %s", gst_video_format_to_string(out_info->fmt));
diff --git a/libs/gstimxcommon.c b/libs/gstimxcommon.c
index 0d50130..1fa8d8b 100755
--- a/libs/gstimxcommon.c
+++ b/libs/gstimxcommon.c
@@ -178,36 +178,34 @@ CHIP_CODE getChipCodeFromSocid (void)
return code;
}
-int get_kernel_version (void)
-{
- struct utsname sys_name;
- int kv_major, kv_minor, kv_rel;
-
- if (uname(&sys_name) < 0) {
- g_print("get kernel version via uname failed.\n");
- return -1;
- }
- if (sscanf(sys_name.release, "%d.%d.%d", &kv_major, &kv_minor, &kv_rel) != 3) {
- g_print("sscanf kernel version failed.\n");
- return -1;
- }
-
- return KERN_VER (kv_major, kv_minor, kv_rel);
-}
+#define KERN_VER(a, b, c) (((a) << 16) + ((b) << 8) + (c))
static CHIP_CODE gimx_chip_code = CC_UNKN;
CHIP_CODE imx_chip_code (void)
{
- int kv;
+ struct utsname sys_name;
+ int kv, kv_major, kv_minor, kv_rel;
+ char soc_name[255];
+ int rev_major, rev_minor;
+ int idx, num;
if (gimx_chip_code != CC_UNKN)
return gimx_chip_code;
- kv = get_kernel_version();
- if (kv < 0)
+ if (uname(&sys_name) < 0) {
+ g_print("get kernel version via uname failed.\n");
+ return CC_UNKN;
+ }
+
+ if (sscanf(sys_name.release, "%d.%d.%d", &kv_major, &kv_minor, &kv_rel) != 3) {
+ g_print("sscanf kernel version failed.\n");
return CC_UNKN;
+ }
+
+ kv = ((kv_major << 16) + (kv_minor << 8) + kv_rel);
+ //GST_INFO("kernel:%s, %d.%d.%d\n", sys_name.release, kv_major, kv_minor, kv_rel);
if (kv < KERN_VER(3, 10, 0))
gimx_chip_code = getChipCodeFromCpuinfo();
diff --git a/libs/gstimxcommon.h b/libs/gstimxcommon.h
index 09df117..8d3555b 100755
--- a/libs/gstimxcommon.h
+++ b/libs/gstimxcommon.h
@@ -108,9 +108,6 @@ CHIP_CODE getChipCodeFromSocid (void);
CHIP_CODE imx_chip_code (void);
gboolean check_feature(CHIP_CODE chip_name, CHIP_FEATURE feature);
-#define KERN_VER(a, b, c) (((a) << 16) + ((b) << 8) + (c))
-int get_kernel_version (void);
-
#define HAS_G3D() check_feature(imx_chip_code(), G3D)
#define HAS_G2D() check_feature(imx_chip_code(), G2D)
#define HAS_IPU() check_feature(imx_chip_code(), IPU)