Date:2011-11-26 05:10:00 (7 years 7 months ago)
Author:Werner Almesberger
Commit:6ba362d8d9a0a9f7e45d794daddf21ad48491bd3
Message:m1/patches/: added milkymist-videoformat.patch (posted Fri Nov 25)

Files: m1/patches/rtems/milkymist-videoformat.patch (1 diff)
m1/patches/rtems/series (1 diff)

Change Details

m1/patches/rtems/milkymist-videoformat.patch
1Date: Fri, 25 Nov 2011 16:22:29 +0100
2From: S?bastien Bourdeauducq <sebastien@milkymist.org>
3To: "Milkymist One, Milkymist SoC and Flickernoise developers' list"
4        <devel@lists.milkymist.org>
5Subject: [Milkymist-devel] RTEMS patch for video formats
6
7[-- Attachment #1 --]
8[-- Type: text/plain, Encoding: 7bit, Size: 0.5K --]
9
10Hi,
11
12The attached patch implements RTEMS driver support for different video
13formats.
14
15S-Video and Component are untested, because I do not have suitable
16sources. However, when using these modes, feeding the composite signal
17into the Y input gives a greyscale picture, so they likely work.
18
19I'm also sending a screenshot of the new video input settings dialog.
20When in composite mode, I'm planning to add keyboard shortcuts to
21switch between the 3 inputs live.
22
23S.
24
25Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h
26===================================================================
27--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_video/milkymist_video.h 2011-08-01 10:48:40.000000000 -0300
28@@ -8,7 +8,7 @@
29  *
30  * $Id: milkymist_video.h,v 1.1 2011/08/01 13:48:40 joel Exp $
31  *
32- * COPYRIGHT (c) 2010 Sebastien Bourdeauducq
33+ * COPYRIGHT (c) 2010, 2011 Sebastien Bourdeauducq
34  */
35
36 #ifndef __MILKYMIST_VIDEO_H_
37@@ -33,6 +33,16 @@
38 #define VIDEO_SET_REGISTER 0x5609
39 #define VIDEO_GET_REGISTER 0x560a
40
41+#define VIDEO_SET_FORMAT 0x560b
42+
43+enum {
44+ VIDEO_FORMAT_CVBS6 = 0,
45+ VIDEO_FORMAT_CVBS5,
46+ VIDEO_FORMAT_CVBS4,
47+ VIDEO_FORMAT_SVIDEO,
48+ VIDEO_FORMAT_COMPONENT,
49+};
50+
51 rtems_device_driver video_initialize(
52   rtems_device_major_number major,
53   rtems_device_minor_number minor,
54Index: rtems/c/src/lib/libbsp/lm32/shared/milkymist_video/video.c
55===================================================================
56--- rtems.orig/c/src/lib/libbsp/lm32/shared/milkymist_video/video.c 2011-08-01 10:48:40.000000000 -0300
57@@ -267,6 +267,37 @@
58   );
59 }
60
61+static void set_format(int format)
62+{
63+ switch(format) {
64+ case VIDEO_FORMAT_CVBS6:
65+ write_reg(0x00, 0x00);
66+ write_reg(0xc3, 0x05);
67+ write_reg(0xc4, 0x80);
68+ break;
69+ case VIDEO_FORMAT_CVBS5:
70+ write_reg(0x00, 0x00);
71+ write_reg(0xc3, 0x0d);
72+ write_reg(0xc4, 0x80);
73+ break;
74+ case VIDEO_FORMAT_CVBS4:
75+ write_reg(0x00, 0x00);
76+ write_reg(0xc3, 0x04);
77+ write_reg(0xc4, 0x80);
78+ break;
79+ case VIDEO_FORMAT_SVIDEO:
80+ write_reg(0x00, 0x06);
81+ write_reg(0xc3, 0xd5);
82+ write_reg(0xc4, 0x80);
83+ break;
84+ case VIDEO_FORMAT_COMPONENT:
85+ write_reg(0x00, 0x09);
86+ write_reg(0xc3, 0x45);
87+ write_reg(0xc4, 0x8d);
88+ break;
89+ }
90+}
91+
92 rtems_device_driver video_control(
93   rtems_device_major_number major,
94   rtems_device_minor_number minor,
95@@ -333,7 +364,7 @@
96       break;
97
98     case VIDEO_SET_REGISTER:
99- write_reg(((unsigned int )a & 0xffff0000) >> 16,
100+ write_reg(((unsigned int)a & 0xffff0000) >> 16,
101         (unsigned int)a & 0x0000ffff);
102       sc = RTEMS_SUCCESSFUL;
103       break;
104@@ -342,6 +373,11 @@
105       sc = RTEMS_SUCCESSFUL;
106       break;
107
108+ case VIDEO_SET_FORMAT:
109+ set_format((int)a);
110+ sc = RTEMS_SUCCESSFUL;
111+ break;
112+
113     default:
114       sc = RTEMS_UNSATISFIED;
115       break;
m1/patches/rtems/series
55milkymist-new-uart.patch
66fix-sysconf-includes.patch
77milkymist-map-sysfreq.patch
8milkymist-videoformat.patch

Archive Download the corresponding diff file

Branches:
master



interactive