OSDN Git Service

change device driver to push 128 data at once
authorKenichi Kurimoto <kurimoto12@users.sourceforge.jp>
Sun, 9 Jan 2011 13:17:30 +0000 (22:17 +0900)
committerKenichi Kurimoto <kurimoto12@users.sourceforge.jp>
Sun, 9 Jan 2011 13:17:30 +0000 (22:17 +0900)
snapgear-2.6-p42/linux-2.6.21.1/drivers/kmjpeg/kmjpeg.c
snapgear-2.6-p42/linux-2.6.21.1/drivers/kmjpeg/kmjpeg.h
snapgear-2.6-p42/user/jpeg-6b/jdcolor.c

index 3aae65e..a92e24f 100644 (file)
@@ -22,6 +22,7 @@ MODULE_LICENSE("GPL");
 
 #define DRIVER_NAME "kmjpeg"
 
+
 #define AHBADD 0xa0000000
 #define RDYADD 0xa0000200
 #define APBADD 0x80000c00
@@ -84,11 +85,10 @@ int kmjpeg_ioctl(struct inode *inode, struct file *filep, unsigned int cmd, unsi
      if((tmp & 0x80000000) == 0x80000000)break;
      for(i=0;i<800;i++);
    }
-   *hdata = datawrite.pixeldata;
-   //   for(i=0;i<256;i++){
-   //    *hdata = data4b.fourbdata[i];
-     //     for(j=0;j<100000;j++);
-   //   }
+   //  *hdata = datawrite.pixeldata;
+   for(i=0;i<128;i++){
+     *hdata = datawrite.fourbdata[i];
+   }
    break;
   
   case IOCTL_REGSET :
index a8143e6..8f96e20 100644 (file)
@@ -1,8 +1,8 @@
 #include <linux/ioctl.h>
 
 struct ioctl_cmdwrite{
-  unsigned int pixeldata;
-  //  unsigned int fourbdata[256];
+  //  unsigned int pixeldata;
+  unsigned int fourbdata[128];
 };
 struct ioctl_cmdreg{
   unsigned int fb;
index df211d8..401862e 100644 (file)
@@ -14,6 +14,7 @@
 
 #include "kmjpeg.h"
 static int call_num = 0;
+static int pixel_num = 0;
 
 
 
@@ -174,8 +175,12 @@ ycc_rgb_convert (j_decompress_ptr cinfo,
        }*/
       /*LEON-motionJPEG prj  for hard IP : yccrgbs*/
       pixcoldata =(unsigned int)( y <<16 | cb <<8 | cr);
-      writedata.pixeldata = pixcoldata;
-      ioctl(cinfo->dev_fd, IOCTL_WRITE, &writedata); 
+      writedata.fourbdata[pixel_num] = pixcoldata;
+      pixel_num++;
+      if(pixel_num == 128){
+       ioctl(cinfo->dev_fd, IOCTL_WRITE, &writedata);
+       pixel_num = 0;
+      } 
       outptr += RGB_PIXELSIZE;
     }
   }
@@ -422,4 +427,5 @@ jinit_color_deconverter (j_decompress_ptr cinfo)
 
   /*V1 LEON-mjpeg project */
   call_num = 0;
+  pixel_num = 0;
 }