From 3f1dd219d1be26e5b133d89f5df18a7c60f0f912 Mon Sep 17 00:00:00 2001 From: Markham Date: Fri, 22 Apr 2016 08:29:45 +0200 Subject: [PATCH] lcd4linux: add latest patch & new driver patch --- archive-patches/lcd4linux-svn1179-spf.patch | 127 ++++++++++++++++++ .../lcd4linux-svn1179b-addDrv-spf.patch | 39 ++++++ archive-patches/lcd4linux_fixownererror.diff | 21 +++ 3 files changed, 187 insertions(+) create mode 100644 archive-patches/lcd4linux-svn1179-spf.patch create mode 100644 archive-patches/lcd4linux-svn1179b-addDrv-spf.patch create mode 100644 archive-patches/lcd4linux_fixownererror.diff diff --git a/archive-patches/lcd4linux-svn1179-spf.patch b/archive-patches/lcd4linux-svn1179-spf.patch new file mode 100644 index 0000000..d03d0cd --- /dev/null +++ b/archive-patches/lcd4linux-svn1179-spf.patch @@ -0,0 +1,127 @@ +diff -ruN '--exclude=.svn' lcd4linux-svn1179/drv_SamsungSPF.c lcd4linux/drv_SamsungSPF.c +--- lcd4linux-svn1179/drv_SamsungSPF.c 2012-02-26 22:17:04.000000000 +0100 ++++ lcd4linux/drv_SamsungSPF.c 2012-02-26 23:31:06.000000000 +0100 +@@ -52,6 +52,7 @@ + + /* graphic display? */ + #include "drv_generic_graphic.h" ++#include "jpeg_mem_dest.h" + + // Drivername for verbose output + static char Name[] = "SamsungSPF"; +diff -ruN '--exclude=.svn' lcd4linux-svn1179/jpeg_mem_dest.h lcd4linux/jpeg_mem_dest.h +--- lcd4linux-svn1179/jpeg_mem_dest.h 1970-01-01 01:00:00.000000000 +0100 ++++ lcd4linux/jpeg_mem_dest.h 2012-02-26 23:30:06.000000000 +0100 +@@ -0,0 +1,112 @@ ++#define ERREXIT(cinfo,code) \ ++ ((cinfo)->err->msg_code = (code), \ ++ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) ++#define ERREXIT1(cinfo,code,p1) \ ++ ((cinfo)->err->msg_code = (code), \ ++ (cinfo)->err->msg_parm.i[0] = (p1), \ ++ (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) ++ ++#define JERR_OUT_OF_MEMORY "Insufficient memory (case %d)" ++#define JERR_BUFFER_SIZE "Buffer passed to JPEG library is too small" ++ ++#define OUTPUT_BUF_SIZE 4096 /* choose an efficiently fwrite'able size */ ++ ++ ++/* Expanded data destination object for memory output */ ++ ++typedef struct { ++ struct jpeg_destination_mgr pub; /* public fields */ ++ ++ unsigned char ** outbuffer; /* target buffer */ ++ unsigned long * outsize; ++ unsigned char * newbuffer; /* newly allocated buffer */ ++ JOCTET * buffer; /* start of buffer */ ++ size_t bufsize; ++} my_mem_destination_mgr; ++ ++typedef my_mem_destination_mgr * my_mem_dest_ptr; ++ ++ ++METHODDEF(void) ++init_mem_destination (j_compress_ptr cinfo) ++{ ++ /* no work necessary here */ ++} ++ ++METHODDEF(boolean) ++empty_mem_output_buffer (j_compress_ptr cinfo) ++{ ++ size_t nextsize; ++ JOCTET * nextbuffer; ++ my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; ++ ++ /* Try to allocate new buffer with double size */ ++ nextsize = dest->bufsize * 2; ++ nextbuffer = (JOCTET *) malloc(nextsize); ++ ++ if (nextbuffer == NULL) ++ ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); ++ ++ memcpy(nextbuffer, dest->buffer, dest->bufsize); ++ ++ if (dest->newbuffer != NULL) ++ free(dest->newbuffer); ++ ++ dest->newbuffer = nextbuffer; ++ ++ dest->pub.next_output_byte = nextbuffer + dest->bufsize; ++ dest->pub.free_in_buffer = dest->bufsize; ++ ++ dest->buffer = nextbuffer; ++ dest->bufsize = nextsize; ++ ++ return TRUE; ++} ++ ++METHODDEF(void) ++term_mem_destination (j_compress_ptr cinfo) ++{ ++ my_mem_dest_ptr dest = (my_mem_dest_ptr) cinfo->dest; ++ ++ *dest->outbuffer = dest->buffer; ++ *dest->outsize = dest->bufsize - dest->pub.free_in_buffer; ++} ++ ++GLOBAL(void) ++jpeg_mem_dest (j_compress_ptr cinfo, ++ unsigned char ** outbuffer, unsigned long * outsize) ++{ ++ my_mem_dest_ptr dest; ++ ++ if (outbuffer == NULL || outsize == NULL) /* sanity check */ ++ ERREXIT(cinfo, JERR_BUFFER_SIZE); ++ ++ /* The destination object is made permanent so that multiple JPEG images ++ * can be written to the same buffer without re-executing jpeg_mem_dest. ++ */ ++ if (cinfo->dest == NULL) { /* first time for this JPEG object? */ ++ cinfo->dest = (struct jpeg_destination_mgr *) ++ (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, ++ sizeof(my_mem_destination_mgr)); ++ } ++ ++ dest = (my_mem_dest_ptr) cinfo->dest; ++ dest->pub.init_destination = init_mem_destination; ++ dest->pub.empty_output_buffer = empty_mem_output_buffer; ++ dest->pub.term_destination = term_mem_destination; ++ dest->outbuffer = outbuffer; ++ dest->outsize = outsize; ++ dest->newbuffer = NULL; ++ ++ if (*outbuffer == NULL || *outsize == 0) { ++ /* Allocate initial buffer */ ++ dest->newbuffer = *outbuffer = (unsigned char *) malloc(OUTPUT_BUF_SIZE); ++ if (dest->newbuffer == NULL) ++ ERREXIT1(cinfo, JERR_OUT_OF_MEMORY, 10); ++ *outsize = OUTPUT_BUF_SIZE; ++ } ++ ++ dest->pub.next_output_byte = dest->buffer = *outbuffer; ++ dest->pub.free_in_buffer = dest->bufsize = *outsize; ++} ++ diff --git a/archive-patches/lcd4linux-svn1179b-addDrv-spf.patch b/archive-patches/lcd4linux-svn1179b-addDrv-spf.patch new file mode 100644 index 0000000..0b9c68c --- /dev/null +++ b/archive-patches/lcd4linux-svn1179b-addDrv-spf.patch @@ -0,0 +1,39 @@ +--- lcd4linux/drv_SamsungSPF.c 2016-04-21 22:58:57.753031858 +0200 ++++ lcd4linux/drv_SamsungSPF_work.c 2016-04-21 23:14:02.685002452 +0200 +@@ -90,6 +90,20 @@ + .xRes = 1024, + .yRes = 600, + }, ++ { ++ .type = "SPF-87H", ++ .vendorID = 0x04e8, ++ .productID = {0x2033, 0x2034}, ++ .xRes = 800, ++ .yRes = 480, ++ }, ++ { ++ .type = "SPF-87H(old)", ++ .vendorID = 0x04e8, ++ .productID = {0x2025, 0x2026}, ++ .xRes = 800, ++ .yRes = 480, ++ } + }; + + static int numFrames = sizeof(spfDevices) / sizeof(spfDevices[0]); +@@ -280,6 +294,15 @@ + return -1; + } + ++ //Keep SPF87h and friends in MiniMonitorMode ++ char bytes[]={0x09, 0x04}; ++ ++ if ((ret = usb_control_msg(myDevHandle, 0xc0, 0x01, 0x0000, 0x0000, bytes, 0x02, 1000)) < 0) ++ { ++ error("%s: Error occurred while sending control_msg to device.", Name); ++ error("%s: usb_control_msg returned: %d", Name, ret); ++ }; ++ + return 0; + } + diff --git a/archive-patches/lcd4linux_fixownererror.diff b/archive-patches/lcd4linux_fixownererror.diff new file mode 100644 index 0000000..edac0bb --- /dev/null +++ b/archive-patches/lcd4linux_fixownererror.diff @@ -0,0 +1,21 @@ +diff -Naur lcd4linux/cfg.c lcd4linux/cfg.c +--- lcd4linux/cfg.c 2012-12-30 15:52:25.000000000 +0100 ++++ lcd4linux/cfg.c 2012-12-30 16:10:56.000000000 +0100 +@@ -481,7 +481,7 @@ + error("security error: '%s' is not a regular file", file); + error = -1; + } +- if (stbuf.st_uid != uid || stbuf.st_gid != gid) { ++/* if (stbuf.st_uid != uid || stbuf.st_gid != gid) { + error("security error: owner and/or group of '%s' don't match", file); + error = -1; + } +@@ -491,7 +491,7 @@ + error = -1; + } + #endif +- return error; ++*/ return error; + } + + -- 2.39.5