@@ -90,13 +90,44 @@ static const struct rcar_du_format_info rcar_du_format_infos[] = {
90
90
.pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC ,
91
91
.edf = PnDDCR4_EDF_NONE ,
92
92
}, {
93
- /* In YUV 4:2:2, only NV16 is supported (NV61 isn't) */
94
93
.fourcc = DRM_FORMAT_NV16 ,
95
94
.bpp = 16 ,
96
95
.planes = 2 ,
97
96
.pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC ,
98
97
.edf = PnDDCR4_EDF_NONE ,
99
98
},
99
+ /* The following formats are not supported on Gen2 and thus have no
100
+ * associated .pnmr or .edf settings.
101
+ */
102
+ {
103
+ .fourcc = DRM_FORMAT_NV61 ,
104
+ .bpp = 16 ,
105
+ .planes = 2 ,
106
+ }, {
107
+ .fourcc = DRM_FORMAT_YUV420 ,
108
+ .bpp = 12 ,
109
+ .planes = 3 ,
110
+ }, {
111
+ .fourcc = DRM_FORMAT_YVU420 ,
112
+ .bpp = 12 ,
113
+ .planes = 3 ,
114
+ }, {
115
+ .fourcc = DRM_FORMAT_YUV422 ,
116
+ .bpp = 16 ,
117
+ .planes = 3 ,
118
+ }, {
119
+ .fourcc = DRM_FORMAT_YVU422 ,
120
+ .bpp = 16 ,
121
+ .planes = 3 ,
122
+ }, {
123
+ .fourcc = DRM_FORMAT_YUV444 ,
124
+ .bpp = 24 ,
125
+ .planes = 3 ,
126
+ }, {
127
+ .fourcc = DRM_FORMAT_YVU444 ,
128
+ .bpp = 24 ,
129
+ .planes = 3 ,
130
+ },
100
131
};
101
132
102
133
const struct rcar_du_format_info * rcar_du_format_info (u32 fourcc )
@@ -144,6 +175,7 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
144
175
unsigned int max_pitch ;
145
176
unsigned int align ;
146
177
unsigned int bpp ;
178
+ unsigned int i ;
147
179
148
180
format = rcar_du_format_info (mode_cmd -> pixel_format );
149
181
if (format == NULL ) {
@@ -156,7 +188,7 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
156
188
* The pitch and alignment constraints are expressed in pixels on the
157
189
* hardware side and in bytes in the DRM API.
158
190
*/
159
- bpp = format -> planes == 2 ? 1 : format -> bpp / 8 ;
191
+ bpp = format -> planes == 1 ? format -> bpp / 8 : 1 ;
160
192
max_pitch = 4096 * bpp ;
161
193
162
194
if (rcar_du_needs (rcdu , RCAR_DU_QUIRK_ALIGN_128B ))
@@ -171,8 +203,8 @@ rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
171
203
return ERR_PTR (- EINVAL );
172
204
}
173
205
174
- if ( format -> planes == 2 ) {
175
- if (mode_cmd -> pitches [1 ] != mode_cmd -> pitches [0 ]) {
206
+ for ( i = 1 ; i < format -> planes ; ++ i ) {
207
+ if (mode_cmd -> pitches [i ] != mode_cmd -> pitches [0 ]) {
176
208
dev_dbg (dev -> dev ,
177
209
"luma and chroma pitches do not match\n" );
178
210
return ERR_PTR (- EINVAL );
0 commit comments