Browse Source

wave521: strictly treat building warning as error and fix warning

And remove unused file

Signed-off-by: Andy Hu <andy.hu@starfivetech.com>
Andy Hu 2 years ago
parent
commit
b116a455f5

+ 1 - 1
soft_3rdpart/wave521/code/WaveEncDriver_buildroot.mak

@@ -13,7 +13,7 @@ export SUBARCH=riscv
 export CROSS_COMPILE=riscv64-buildroot-linux-gnu-
 
 DRV_PATH  := $(shell pwd)/vdi/linux/driver
-EXTRA_CFLAGS +=	$(DEBFLAGS) -I$(LDDINCDIR) -Wno-unused-function
+EXTRA_CFLAGS +=	$(DEBFLAGS) -I$(LDDINCDIR)
 
 ifneq ($(KERNELRELEASE),)
 # call from kernel build system

+ 1 - 1
soft_3rdpart/wave521/code/WaveEncoder_buildroot.mak

@@ -72,7 +72,7 @@ else
 endif	#USE_RTL_SIM
 DEFINES += $(USER_DEFINES)
 DEFINES += -DUSE_FEEDING_METHOD_BUFFER
-CFLAGS  += -g -I. -Wno-implicit-function-declaration -Wno-format -Wl,--fatal-warning $(INCLUDES) $(DEFINES) $(PLATFORM_FLAGS)
+CFLAGS  += -g -I. -Wl,--fatal-warning $(INCLUDES) $(DEFINES) $(PLATFORM_FLAGS)
 ifeq ($(USE_RTL_SIM), yes)
 ifeq ($(IUS), 1)
 CFLAGS  += -fPIC # ncverilog is 64bit version

+ 1 - 1
soft_3rdpart/wave521/code/sample_v2/component_encoder/component_enc_encoder.c

@@ -22,7 +22,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
-
+#include <unistd.h>
 #include <string.h>
 #include <time.h>
 #include <sys/time.h>

+ 7 - 0
soft_3rdpart/wave521/code/sample_v2/helper/main_helper.h

@@ -1415,6 +1415,13 @@ BOOL AllocateDecFrameBuffer(
     Uint32*         retStride
     );
 
+BOOL AttachFBMemory(
+    Uint32 coreIdx,
+    vpu_buffer_t *pFbMem,
+    FrameBuffer* pFb,
+    void *pBuffer,
+    Uint32 size);
+
 BOOL AllocFBMemory(
     Uint32 coreIdx,
     vpu_buffer_t *pFbMem,

+ 13 - 6
soft_3rdpart/wave521/code/vdi/linux/driver/venc.c

@@ -117,9 +117,11 @@ static video_mm_t s_vmem;
 static vpudrv_buffer_t s_video_memory = {0};
 #endif /*VPU_SUPPORT_RESERVED_VIDEO_MEMORY*/
 
+#ifndef VPU_SUPPORT_CLOCK_CONTROL
 static int vpu_hw_reset(void);
 static void vpu_clk_disable(void);
 static int vpu_clk_enable(void);
+#endif
 
 /* end customer definition */
 static vpudrv_buffer_t s_instance_pool = {0};
@@ -649,7 +651,12 @@ static long vpu_ioctl(struct file *filp, u_int cmd, u_long arg)
 	switch (cmd) {
 	case VDI_IOCTL_GET_PHYSICAL_MEMORY:
         {
-            vpudrv_buffer_pool_t *vbp;
+            vpudrv_buffer_pool_t *vbp = NULL;
+            void *user_address = NULL;
+            struct task_struct *my_struct = NULL;
+            struct mm_struct *mm = NULL;
+            unsigned long address = 0;
+            pgd_t *pgd = NULL;
             if ((ret = down_interruptible(&s_vpu_sem)) == 0) {
                 vbp = kzalloc(sizeof(*vbp), GFP_KERNEL);
                 if (!vbp) {
@@ -663,11 +670,11 @@ static long vpu_ioctl(struct file *filp, u_int cmd, u_long arg)
                     return -EFAULT;
                 }
 
-                void *user_address = (void *)vbp->vb.virt_addr;
-                struct task_struct *my_struct = get_current();
-                struct mm_struct *mm = my_struct->mm;
-                unsigned long address = (unsigned long)user_address;
-                pgd_t *pgd = pgd_offset(mm, address);
+                user_address = (void *)vbp->vb.virt_addr;
+                my_struct = get_current();
+                mm = my_struct->mm;
+                address = (unsigned long)user_address;
+                pgd = pgd_offset(mm, address);
 
                 if (!pgd_none(*pgd) && !pgd_bad(*pgd)) {
                     p4d_t *p4d = p4d_offset(pgd, address);

+ 0 - 2
soft_3rdpart/wave521/code/vdi/linux/driver/venc.mod

@@ -1,2 +0,0 @@
-/home/samin/data/startlight/freedom-u-sdk/soft_3rdparty/wave521/code/vdi/linux/driver/venc.o
-

+ 1 - 0
soft_3rdpart/wave521/code/vdi/linux/vdi_osal.c

@@ -25,6 +25,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <unistd.h>
 #include <string.h>
 #include <stdarg.h>
 #include <errno.h>

+ 1 - 1
soft_3rdpart/wave521/code/vdi/vdi.h

@@ -142,7 +142,7 @@ extern "C" {
     int vdi_clear_memory(unsigned long core_idx, PhysicalAddress addr, int len, int endian);
     int vdi_write_memory(unsigned long core_idx, PhysicalAddress addr, unsigned char *data, int len, int endian);
     int vdi_read_memory(unsigned long core_idx, PhysicalAddress addr, unsigned char *data, int len, int endian);
-
+    int vdi_virt_to_phys(unsigned long core_idx, vpu_buffer_t *vb);
 
     int vdi_lock(unsigned long core_idx);
     void vdi_unlock(unsigned long core_idx);

+ 1 - 0
soft_3rdpart/wave521/code/vpuapi/coda9/coda9.c

@@ -26,6 +26,7 @@
 #include "coda9_vpuconfig.h"
 #include "product.h"
 #include "coda9_regdefine.h"
+#include "misc/debug.h"
 
 static void LoadBitCode(Uint32 coreIdx, PhysicalAddress codeBase, const Uint16 *codeWord, int codeSize)
 {

+ 1 - 1
soft_3rdpart/wave521/code/vpuapi/vpuapi.c

@@ -27,7 +27,7 @@
 #include "product.h"
 #include "wave/wave5_regdefine.h"
 #include "wave/wave5.h"
-
+#include "misc/debug.h"
 
 
 #define W5_RET_DEC_DISPLAY_SIZE (W5_REG_BASE + 0x01D8)      // [FIX ME] delete ? or not?

+ 1 - 1
soft_3rdpart/wave521/code/vpuapi/vpuapifunc.c

@@ -29,7 +29,7 @@
 #include "coda9/coda9_regdefine.h"
 #include "coda9/coda9_vpuconfig.h"
 #include "wave/wave5_regdefine.h"
-
+#include "misc/debug.h"
 
 #ifndef MIN
 #define MIN(a, b)       (((a) < (b)) ? (a) : (b))

+ 1 - 0
soft_3rdpart/wave521/code/vpuapi/wave/wave5.c

@@ -27,6 +27,7 @@
 #include "wave/wave5.h"
 #include "vpuerror.h"
 #include "wave/wave5_regdefine.h"
+#include "misc/debug.h"
 
 Uint32 Wave5VpuIsInit(Uint32 coreIdx)
 {