diff mbox series

[2/4] media: v4l2-tpg-core: Add support for 32-bit packed YUV formats

Message ID 20190208031846.14453-3-vivek.kasireddy@intel.com (mailing list archive)
State New, archived
Headers show
Series Add support for 32-bit packed YUV formats | expand

Commit Message

Kasireddy, Vivek Feb. 8, 2019, 3:18 a.m. UTC
Add support for the following formats to tpg:
 V4L2_PIX_FMT_AYUV32
 V4L2_PIX_FMT_XYUV32
 V4L2_PIX_FMT_VUYA32
 V4L2_PIX_FMT_VUYX32

Cc: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy@intel.com>
---
 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

kernel test robot Feb. 8, 2019, 10:21 a.m. UTC | #1
Hi Vivek,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.0-rc4 next-20190207]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vivek-Kasireddy/Add-support-for-32-bit-packed-YUV-formats/20190208-173506
base:   git://linuxtv.org/media_tree.git master
config: i386-randconfig-x017-201905 (attached as .config)
compiler: gcc-8 (Debian 8.2.0-15) 8.2.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c: In function 'gen_twopix':
>> drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1283:2: error: duplicate case value
     case V4L2_PIX_FMT_YUV32:
     ^~~~
   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1281:2: note: previously used here
     case V4L2_PIX_FMT_YUV32:
     ^~~~

vim +1283 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c

  1051	
  1052	/* 'odd' is true for pixels 1, 3, 5, etc. and false for pixels 0, 2, 4, etc. */
  1053	static void gen_twopix(struct tpg_data *tpg,
  1054			u8 buf[TPG_MAX_PLANES][8], int color, bool odd)
  1055	{
  1056		unsigned offset = odd * tpg->twopixelsize[0] / 2;
  1057		u8 alpha = tpg->alpha_component;
  1058		u8 r_y_h, g_u_s, b_v;
  1059	
  1060		if (tpg->alpha_red_only && color != TPG_COLOR_CSC_RED &&
  1061					   color != TPG_COLOR_100_RED &&
  1062					   color != TPG_COLOR_75_RED)
  1063			alpha = 0;
  1064		if (color == TPG_COLOR_RANDOM)
  1065			precalculate_color(tpg, color);
  1066		r_y_h = tpg->colors[color][0]; /* R or precalculated Y, H */
  1067		g_u_s = tpg->colors[color][1]; /* G or precalculated U, V */
  1068		b_v = tpg->colors[color][2]; /* B or precalculated V */
  1069	
  1070		switch (tpg->fourcc) {
  1071		case V4L2_PIX_FMT_GREY:
  1072			buf[0][offset] = r_y_h;
  1073			break;
  1074		case V4L2_PIX_FMT_Y10:
  1075			buf[0][offset] = (r_y_h << 2) & 0xff;
  1076			buf[0][offset+1] = r_y_h >> 6;
  1077			break;
  1078		case V4L2_PIX_FMT_Y12:
  1079			buf[0][offset] = (r_y_h << 4) & 0xff;
  1080			buf[0][offset+1] = r_y_h >> 4;
  1081			break;
  1082		case V4L2_PIX_FMT_Y16:
  1083		case V4L2_PIX_FMT_Z16:
  1084			/*
  1085			 * Ideally both bytes should be set to r_y_h, but then you won't
  1086			 * be able to detect endian problems. So keep it 0 except for
  1087			 * the corner case where r_y_h is 0xff so white really will be
  1088			 * white (0xffff).
  1089			 */
  1090			buf[0][offset] = r_y_h == 0xff ? r_y_h : 0;
  1091			buf[0][offset+1] = r_y_h;
  1092			break;
  1093		case V4L2_PIX_FMT_Y16_BE:
  1094			/* See comment for V4L2_PIX_FMT_Y16 above */
  1095			buf[0][offset] = r_y_h;
  1096			buf[0][offset+1] = r_y_h == 0xff ? r_y_h : 0;
  1097			break;
  1098		case V4L2_PIX_FMT_YUV422M:
  1099		case V4L2_PIX_FMT_YUV422P:
  1100		case V4L2_PIX_FMT_YUV420:
  1101		case V4L2_PIX_FMT_YUV420M:
  1102			buf[0][offset] = r_y_h;
  1103			if (odd) {
  1104				buf[1][0] = (buf[1][0] + g_u_s) / 2;
  1105				buf[2][0] = (buf[2][0] + b_v) / 2;
  1106				buf[1][1] = buf[1][0];
  1107				buf[2][1] = buf[2][0];
  1108				break;
  1109			}
  1110			buf[1][0] = g_u_s;
  1111			buf[2][0] = b_v;
  1112			break;
  1113		case V4L2_PIX_FMT_YVU422M:
  1114		case V4L2_PIX_FMT_YVU420:
  1115		case V4L2_PIX_FMT_YVU420M:
  1116			buf[0][offset] = r_y_h;
  1117			if (odd) {
  1118				buf[1][0] = (buf[1][0] + b_v) / 2;
  1119				buf[2][0] = (buf[2][0] + g_u_s) / 2;
  1120				buf[1][1] = buf[1][0];
  1121				buf[2][1] = buf[2][0];
  1122				break;
  1123			}
  1124			buf[1][0] = b_v;
  1125			buf[2][0] = g_u_s;
  1126			break;
  1127	
  1128		case V4L2_PIX_FMT_NV12:
  1129		case V4L2_PIX_FMT_NV12M:
  1130		case V4L2_PIX_FMT_NV16:
  1131		case V4L2_PIX_FMT_NV16M:
  1132			buf[0][offset] = r_y_h;
  1133			if (odd) {
  1134				buf[1][0] = (buf[1][0] + g_u_s) / 2;
  1135				buf[1][1] = (buf[1][1] + b_v) / 2;
  1136				break;
  1137			}
  1138			buf[1][0] = g_u_s;
  1139			buf[1][1] = b_v;
  1140			break;
  1141		case V4L2_PIX_FMT_NV21:
  1142		case V4L2_PIX_FMT_NV21M:
  1143		case V4L2_PIX_FMT_NV61:
  1144		case V4L2_PIX_FMT_NV61M:
  1145			buf[0][offset] = r_y_h;
  1146			if (odd) {
  1147				buf[1][0] = (buf[1][0] + b_v) / 2;
  1148				buf[1][1] = (buf[1][1] + g_u_s) / 2;
  1149				break;
  1150			}
  1151			buf[1][0] = b_v;
  1152			buf[1][1] = g_u_s;
  1153			break;
  1154	
  1155		case V4L2_PIX_FMT_YUV444M:
  1156			buf[0][offset] = r_y_h;
  1157			buf[1][offset] = g_u_s;
  1158			buf[2][offset] = b_v;
  1159			break;
  1160	
  1161		case V4L2_PIX_FMT_YVU444M:
  1162			buf[0][offset] = r_y_h;
  1163			buf[1][offset] = b_v;
  1164			buf[2][offset] = g_u_s;
  1165			break;
  1166	
  1167		case V4L2_PIX_FMT_NV24:
  1168			buf[0][offset] = r_y_h;
  1169			buf[1][2 * offset] = g_u_s;
  1170			buf[1][(2 * offset + 1) % 8] = b_v;
  1171			break;
  1172	
  1173		case V4L2_PIX_FMT_NV42:
  1174			buf[0][offset] = r_y_h;
  1175			buf[1][2 * offset] = b_v;
  1176			buf[1][(2 * offset + 1) % 8] = g_u_s;
  1177			break;
  1178	
  1179		case V4L2_PIX_FMT_YUYV:
  1180			buf[0][offset] = r_y_h;
  1181			if (odd) {
  1182				buf[0][1] = (buf[0][1] + g_u_s) / 2;
  1183				buf[0][3] = (buf[0][3] + b_v) / 2;
  1184				break;
  1185			}
  1186			buf[0][1] = g_u_s;
  1187			buf[0][3] = b_v;
  1188			break;
  1189		case V4L2_PIX_FMT_UYVY:
  1190			buf[0][offset + 1] = r_y_h;
  1191			if (odd) {
  1192				buf[0][0] = (buf[0][0] + g_u_s) / 2;
  1193				buf[0][2] = (buf[0][2] + b_v) / 2;
  1194				break;
  1195			}
  1196			buf[0][0] = g_u_s;
  1197			buf[0][2] = b_v;
  1198			break;
  1199		case V4L2_PIX_FMT_YVYU:
  1200			buf[0][offset] = r_y_h;
  1201			if (odd) {
  1202				buf[0][1] = (buf[0][1] + b_v) / 2;
  1203				buf[0][3] = (buf[0][3] + g_u_s) / 2;
  1204				break;
  1205			}
  1206			buf[0][1] = b_v;
  1207			buf[0][3] = g_u_s;
  1208			break;
  1209		case V4L2_PIX_FMT_VYUY:
  1210			buf[0][offset + 1] = r_y_h;
  1211			if (odd) {
  1212				buf[0][0] = (buf[0][0] + b_v) / 2;
  1213				buf[0][2] = (buf[0][2] + g_u_s) / 2;
  1214				break;
  1215			}
  1216			buf[0][0] = b_v;
  1217			buf[0][2] = g_u_s;
  1218			break;
  1219		case V4L2_PIX_FMT_RGB332:
  1220			buf[0][offset] = (r_y_h << 5) | (g_u_s << 2) | b_v;
  1221			break;
  1222		case V4L2_PIX_FMT_YUV565:
  1223		case V4L2_PIX_FMT_RGB565:
  1224			buf[0][offset] = (g_u_s << 5) | b_v;
  1225			buf[0][offset + 1] = (r_y_h << 3) | (g_u_s >> 3);
  1226			break;
  1227		case V4L2_PIX_FMT_RGB565X:
  1228			buf[0][offset] = (r_y_h << 3) | (g_u_s >> 3);
  1229			buf[0][offset + 1] = (g_u_s << 5) | b_v;
  1230			break;
  1231		case V4L2_PIX_FMT_RGB444:
  1232		case V4L2_PIX_FMT_XRGB444:
  1233			alpha = 0;
  1234			/* fall through */
  1235		case V4L2_PIX_FMT_YUV444:
  1236		case V4L2_PIX_FMT_ARGB444:
  1237			buf[0][offset] = (g_u_s << 4) | b_v;
  1238			buf[0][offset + 1] = (alpha & 0xf0) | r_y_h;
  1239			break;
  1240		case V4L2_PIX_FMT_RGB555:
  1241		case V4L2_PIX_FMT_XRGB555:
  1242			alpha = 0;
  1243			/* fall through */
  1244		case V4L2_PIX_FMT_YUV555:
  1245		case V4L2_PIX_FMT_ARGB555:
  1246			buf[0][offset] = (g_u_s << 5) | b_v;
  1247			buf[0][offset + 1] = (alpha & 0x80) | (r_y_h << 2)
  1248							    | (g_u_s >> 3);
  1249			break;
  1250		case V4L2_PIX_FMT_RGB555X:
  1251		case V4L2_PIX_FMT_XRGB555X:
  1252			alpha = 0;
  1253			/* fall through */
  1254		case V4L2_PIX_FMT_ARGB555X:
  1255			buf[0][offset] = (alpha & 0x80) | (r_y_h << 2) | (g_u_s >> 3);
  1256			buf[0][offset + 1] = (g_u_s << 5) | b_v;
  1257			break;
  1258		case V4L2_PIX_FMT_RGB24:
  1259		case V4L2_PIX_FMT_HSV24:
  1260			buf[0][offset] = r_y_h;
  1261			buf[0][offset + 1] = g_u_s;
  1262			buf[0][offset + 2] = b_v;
  1263			break;
  1264		case V4L2_PIX_FMT_BGR24:
  1265			buf[0][offset] = b_v;
  1266			buf[0][offset + 1] = g_u_s;
  1267			buf[0][offset + 2] = r_y_h;
  1268			break;
  1269		case V4L2_PIX_FMT_BGR666:
  1270			buf[0][offset] = (b_v << 2) | (g_u_s >> 4);
  1271			buf[0][offset + 1] = (g_u_s << 4) | (r_y_h >> 2);
  1272			buf[0][offset + 2] = r_y_h << 6;
  1273			buf[0][offset + 3] = 0;
  1274			break;
  1275		case V4L2_PIX_FMT_RGB32:
  1276		case V4L2_PIX_FMT_XRGB32:
  1277		case V4L2_PIX_FMT_HSV32:
  1278		case V4L2_PIX_FMT_XYUV32:
  1279			alpha = 0;
  1280			/* fall through */
  1281		case V4L2_PIX_FMT_YUV32:
  1282		case V4L2_PIX_FMT_ARGB32:
> 1283		case V4L2_PIX_FMT_YUV32:
  1284		case V4L2_PIX_FMT_AYUV32:
  1285			buf[0][offset] = alpha;
  1286			buf[0][offset + 1] = r_y_h;
  1287			buf[0][offset + 2] = g_u_s;
  1288			buf[0][offset + 3] = b_v;
  1289			break;
  1290		case V4L2_PIX_FMT_BGR32:
  1291		case V4L2_PIX_FMT_XBGR32:
  1292		case V4L2_PIX_FMT_VUYX32:
  1293			alpha = 0;
  1294			/* fall through */
  1295		case V4L2_PIX_FMT_ABGR32:
  1296		case V4L2_PIX_FMT_VUYA32:
  1297			buf[0][offset] = b_v;
  1298			buf[0][offset + 1] = g_u_s;
  1299			buf[0][offset + 2] = r_y_h;
  1300			buf[0][offset + 3] = alpha;
  1301			break;
  1302		case V4L2_PIX_FMT_SBGGR8:
  1303			buf[0][offset] = odd ? g_u_s : b_v;
  1304			buf[1][offset] = odd ? r_y_h : g_u_s;
  1305			break;
  1306		case V4L2_PIX_FMT_SGBRG8:
  1307			buf[0][offset] = odd ? b_v : g_u_s;
  1308			buf[1][offset] = odd ? g_u_s : r_y_h;
  1309			break;
  1310		case V4L2_PIX_FMT_SGRBG8:
  1311			buf[0][offset] = odd ? r_y_h : g_u_s;
  1312			buf[1][offset] = odd ? g_u_s : b_v;
  1313			break;
  1314		case V4L2_PIX_FMT_SRGGB8:
  1315			buf[0][offset] = odd ? g_u_s : r_y_h;
  1316			buf[1][offset] = odd ? b_v : g_u_s;
  1317			break;
  1318		case V4L2_PIX_FMT_SBGGR10:
  1319			buf[0][offset] = odd ? g_u_s << 2 : b_v << 2;
  1320			buf[0][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
  1321			buf[1][offset] = odd ? r_y_h << 2 : g_u_s << 2;
  1322			buf[1][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
  1323			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1324			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1325			break;
  1326		case V4L2_PIX_FMT_SGBRG10:
  1327			buf[0][offset] = odd ? b_v << 2 : g_u_s << 2;
  1328			buf[0][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
  1329			buf[1][offset] = odd ? g_u_s << 2 : r_y_h << 2;
  1330			buf[1][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
  1331			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1332			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1333			break;
  1334		case V4L2_PIX_FMT_SGRBG10:
  1335			buf[0][offset] = odd ? r_y_h << 2 : g_u_s << 2;
  1336			buf[0][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
  1337			buf[1][offset] = odd ? g_u_s << 2 : b_v << 2;
  1338			buf[1][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
  1339			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1340			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1341			break;
  1342		case V4L2_PIX_FMT_SRGGB10:
  1343			buf[0][offset] = odd ? g_u_s << 2 : r_y_h << 2;
  1344			buf[0][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
  1345			buf[1][offset] = odd ? b_v << 2 : g_u_s << 2;
  1346			buf[1][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
  1347			buf[0][offset] |= (buf[0][offset] >> 2) & 3;
  1348			buf[1][offset] |= (buf[1][offset] >> 2) & 3;
  1349			break;
  1350		case V4L2_PIX_FMT_SBGGR12:
  1351			buf[0][offset] = odd ? g_u_s << 4 : b_v << 4;
  1352			buf[0][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
  1353			buf[1][offset] = odd ? r_y_h << 4 : g_u_s << 4;
  1354			buf[1][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
  1355			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1356			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1357			break;
  1358		case V4L2_PIX_FMT_SGBRG12:
  1359			buf[0][offset] = odd ? b_v << 4 : g_u_s << 4;
  1360			buf[0][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
  1361			buf[1][offset] = odd ? g_u_s << 4 : r_y_h << 4;
  1362			buf[1][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
  1363			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1364			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1365			break;
  1366		case V4L2_PIX_FMT_SGRBG12:
  1367			buf[0][offset] = odd ? r_y_h << 4 : g_u_s << 4;
  1368			buf[0][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
  1369			buf[1][offset] = odd ? g_u_s << 4 : b_v << 4;
  1370			buf[1][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
  1371			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1372			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1373			break;
  1374		case V4L2_PIX_FMT_SRGGB12:
  1375			buf[0][offset] = odd ? g_u_s << 4 : r_y_h << 4;
  1376			buf[0][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
  1377			buf[1][offset] = odd ? b_v << 4 : g_u_s << 4;
  1378			buf[1][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
  1379			buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
  1380			buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
  1381			break;
  1382		case V4L2_PIX_FMT_SBGGR16:
  1383			buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : b_v;
  1384			buf[1][offset] = buf[1][offset + 1] = odd ? r_y_h : g_u_s;
  1385			break;
  1386		case V4L2_PIX_FMT_SGBRG16:
  1387			buf[0][offset] = buf[0][offset + 1] = odd ? b_v : g_u_s;
  1388			buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : r_y_h;
  1389			break;
  1390		case V4L2_PIX_FMT_SGRBG16:
  1391			buf[0][offset] = buf[0][offset + 1] = odd ? r_y_h : g_u_s;
  1392			buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : b_v;
  1393			break;
  1394		case V4L2_PIX_FMT_SRGGB16:
  1395			buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : r_y_h;
  1396			buf[1][offset] = buf[1][offset + 1] = odd ? b_v : g_u_s;
  1397			break;
  1398		}
  1399	}
  1400	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Feb. 8, 2019, 10:49 a.m. UTC | #2
Hi Vivek,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v5.0-rc4 next-20190207]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Vivek-Kasireddy/Add-support-for-32-bit-packed-YUV-formats/20190208-173506
base:   git://linuxtv.org/media_tree.git master
config: nds32-allmodconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 6.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=6.4.0 make.cross ARCH=nds32 

All errors (new ones prefixed by >>):

   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c: In function 'gen_twopix':
   drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1283:2: error: duplicate case value
     case V4L2_PIX_FMT_YUV32:
     ^~~~
>> drivers/media/common/v4l2-tpg/v4l2-tpg-core.c:1281:2: error: previously used here
     case V4L2_PIX_FMT_YUV32:
     ^~~~

vim +1281 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c

63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1051  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1052  /* 'odd' is true for pixels 1, 3, 5, etc. and false for pixels 0, 2, 4, etc. */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1053  static void gen_twopix(struct tpg_data *tpg,
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1054  		u8 buf[TPG_MAX_PLANES][8], int color, bool odd)
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1055  {
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1056  	unsigned offset = odd * tpg->twopixelsize[0] / 2;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1057  	u8 alpha = tpg->alpha_component;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1058  	u8 r_y_h, g_u_s, b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1059  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1060  	if (tpg->alpha_red_only && color != TPG_COLOR_CSC_RED &&
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1061  				   color != TPG_COLOR_100_RED &&
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1062  				   color != TPG_COLOR_75_RED)
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1063  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1064  	if (color == TPG_COLOR_RANDOM)
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1065  		precalculate_color(tpg, color);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1066  	r_y_h = tpg->colors[color][0]; /* R or precalculated Y, H */
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1067  	g_u_s = tpg->colors[color][1]; /* G or precalculated U, V */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1068  	b_v = tpg->colors[color][2]; /* B or precalculated V */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1069  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1070  	switch (tpg->fourcc) {
51f3096835 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1071  	case V4L2_PIX_FMT_GREY:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1072  		buf[0][offset] = r_y_h;
51f3096835 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1073  		break;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1074  	case V4L2_PIX_FMT_Y10:
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1075  		buf[0][offset] = (r_y_h << 2) & 0xff;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1076  		buf[0][offset+1] = r_y_h >> 6;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1077  		break;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1078  	case V4L2_PIX_FMT_Y12:
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1079  		buf[0][offset] = (r_y_h << 4) & 0xff;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1080  		buf[0][offset+1] = r_y_h >> 4;
b89fdb5e50 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2017-09-15  1081  		break;
18b3b3b8ed drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1082  	case V4L2_PIX_FMT_Y16:
648301b456 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Hans Verkuil            2018-08-11  1083  	case V4L2_PIX_FMT_Z16:
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1084  		/*
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1085  		 * Ideally both bytes should be set to r_y_h, but then you won't
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1086  		 * be able to detect endian problems. So keep it 0 except for
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1087  		 * the corner case where r_y_h is 0xff so white really will be
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1088  		 * white (0xffff).
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1089  		 */
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1090  		buf[0][offset] = r_y_h == 0xff ? r_y_h : 0;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1091  		buf[0][offset+1] = r_y_h;
18b3b3b8ed drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1092  		break;
b0ce23f065 drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1093  	case V4L2_PIX_FMT_Y16_BE:
afeef4ee23 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-06-05  1094  		/* See comment for V4L2_PIX_FMT_Y16 above */
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1095  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1096  		buf[0][offset+1] = r_y_h == 0xff ? r_y_h : 0;
b0ce23f065 drivers/media/platform/vivid/vivid-tpg.c      Ricardo Ribalda Delgado 2015-05-04  1097  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1098  	case V4L2_PIX_FMT_YUV422M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1099  	case V4L2_PIX_FMT_YUV422P:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1100  	case V4L2_PIX_FMT_YUV420:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1101  	case V4L2_PIX_FMT_YUV420M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1102  		buf[0][offset] = r_y_h;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1103  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1104  			buf[1][0] = (buf[1][0] + g_u_s) / 2;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1105  			buf[2][0] = (buf[2][0] + b_v) / 2;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1106  			buf[1][1] = buf[1][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1107  			buf[2][1] = buf[2][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1108  			break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1109  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1110  		buf[1][0] = g_u_s;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1111  		buf[2][0] = b_v;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1112  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1113  	case V4L2_PIX_FMT_YVU422M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1114  	case V4L2_PIX_FMT_YVU420:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1115  	case V4L2_PIX_FMT_YVU420M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1116  		buf[0][offset] = r_y_h;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1117  		if (odd) {
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1118  			buf[1][0] = (buf[1][0] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1119  			buf[2][0] = (buf[2][0] + g_u_s) / 2;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1120  			buf[1][1] = buf[1][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1121  			buf[2][1] = buf[2][0];
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1122  			break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1123  		}
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1124  		buf[1][0] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1125  		buf[2][0] = g_u_s;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1126  		break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1127  
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1128  	case V4L2_PIX_FMT_NV12:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1129  	case V4L2_PIX_FMT_NV12M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1130  	case V4L2_PIX_FMT_NV16:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1131  	case V4L2_PIX_FMT_NV16M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1132  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1133  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1134  			buf[1][0] = (buf[1][0] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1135  			buf[1][1] = (buf[1][1] + b_v) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1136  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1137  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1138  		buf[1][0] = g_u_s;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1139  		buf[1][1] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1140  		break;
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1141  	case V4L2_PIX_FMT_NV21:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1142  	case V4L2_PIX_FMT_NV21M:
68c90d6496 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1143  	case V4L2_PIX_FMT_NV61:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1144  	case V4L2_PIX_FMT_NV61M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1145  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1146  		if (odd) {
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1147  			buf[1][0] = (buf[1][0] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1148  			buf[1][1] = (buf[1][1] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1149  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1150  		}
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1151  		buf[1][0] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1152  		buf[1][1] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1153  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1154  
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1155  	case V4L2_PIX_FMT_YUV444M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1156  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1157  		buf[1][offset] = g_u_s;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1158  		buf[2][offset] = b_v;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1159  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1160  
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1161  	case V4L2_PIX_FMT_YVU444M:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1162  		buf[0][offset] = r_y_h;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1163  		buf[1][offset] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1164  		buf[2][offset] = g_u_s;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1165  		break;
00036b307c drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2016-02-20  1166  
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1167  	case V4L2_PIX_FMT_NV24:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1168  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1169  		buf[1][2 * offset] = g_u_s;
1a086879fd drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Mauro Carvalho Chehab   2018-03-22  1170  		buf[1][(2 * offset + 1) % 8] = b_v;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1171  		break;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1172  
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1173  	case V4L2_PIX_FMT_NV42:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1174  		buf[0][offset] = r_y_h;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1175  		buf[1][2 * offset] = b_v;
1a086879fd drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Mauro Carvalho Chehab   2018-03-22  1176  		buf[1][(2 * offset + 1) % 8] = g_u_s;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1177  		break;
dde72bd773 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1178  
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1179  	case V4L2_PIX_FMT_YUYV:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1180  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1181  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1182  			buf[0][1] = (buf[0][1] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1183  			buf[0][3] = (buf[0][3] + b_v) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1184  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1185  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1186  		buf[0][1] = g_u_s;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1187  		buf[0][3] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1188  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1189  	case V4L2_PIX_FMT_UYVY:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1190  		buf[0][offset + 1] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1191  		if (odd) {
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1192  			buf[0][0] = (buf[0][0] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1193  			buf[0][2] = (buf[0][2] + b_v) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1194  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1195  		}
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1196  		buf[0][0] = g_u_s;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1197  		buf[0][2] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1198  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1199  	case V4L2_PIX_FMT_YVYU:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1200  		buf[0][offset] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1201  		if (odd) {
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1202  			buf[0][1] = (buf[0][1] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1203  			buf[0][3] = (buf[0][3] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1204  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1205  		}
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1206  		buf[0][1] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1207  		buf[0][3] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1208  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1209  	case V4L2_PIX_FMT_VYUY:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1210  		buf[0][offset + 1] = r_y_h;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1211  		if (odd) {
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1212  			buf[0][0] = (buf[0][0] + b_v) / 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1213  			buf[0][2] = (buf[0][2] + g_u_s) / 2;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1214  			break;
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1215  		}
1f088dc162 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-07  1216  		buf[0][0] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1217  		buf[0][2] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1218  		break;
71491063b8 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1219  	case V4L2_PIX_FMT_RGB332:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1220  		buf[0][offset] = (r_y_h << 5) | (g_u_s << 2) | b_v;
71491063b8 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1221  		break;
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1222  	case V4L2_PIX_FMT_YUV565:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1223  	case V4L2_PIX_FMT_RGB565:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1224  		buf[0][offset] = (g_u_s << 5) | b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1225  		buf[0][offset + 1] = (r_y_h << 3) | (g_u_s >> 3);
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1226  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1227  	case V4L2_PIX_FMT_RGB565X:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1228  		buf[0][offset] = (r_y_h << 3) | (g_u_s >> 3);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1229  		buf[0][offset + 1] = (g_u_s << 5) | b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1230  		break;
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1231  	case V4L2_PIX_FMT_RGB444:
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1232  	case V4L2_PIX_FMT_XRGB444:
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1233  		alpha = 0;
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1234  		/* fall through */
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1235  	case V4L2_PIX_FMT_YUV444:
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1236  	case V4L2_PIX_FMT_ARGB444:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1237  		buf[0][offset] = (g_u_s << 4) | b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1238  		buf[0][offset + 1] = (alpha & 0xf0) | r_y_h;
8aca230b6d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-11  1239  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1240  	case V4L2_PIX_FMT_RGB555:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1241  	case V4L2_PIX_FMT_XRGB555:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1242  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1243  		/* fall through */
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1244  	case V4L2_PIX_FMT_YUV555:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1245  	case V4L2_PIX_FMT_ARGB555:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1246  		buf[0][offset] = (g_u_s << 5) | b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1247  		buf[0][offset + 1] = (alpha & 0x80) | (r_y_h << 2)
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1248  						    | (g_u_s >> 3);
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1249  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1250  	case V4L2_PIX_FMT_RGB555X:
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1251  	case V4L2_PIX_FMT_XRGB555X:
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1252  		alpha = 0;
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1253  		/* fall through */
8f1ff5435d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-12  1254  	case V4L2_PIX_FMT_ARGB555X:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1255  		buf[0][offset] = (alpha & 0x80) | (r_y_h << 2) | (g_u_s >> 3);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1256  		buf[0][offset + 1] = (g_u_s << 5) | b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1257  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1258  	case V4L2_PIX_FMT_RGB24:
54fb153483 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1259  	case V4L2_PIX_FMT_HSV24:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1260  		buf[0][offset] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1261  		buf[0][offset + 1] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1262  		buf[0][offset + 2] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1263  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1264  	case V4L2_PIX_FMT_BGR24:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1265  		buf[0][offset] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1266  		buf[0][offset + 1] = g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1267  		buf[0][offset + 2] = r_y_h;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1268  		break;
68cd4e9f21 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1269  	case V4L2_PIX_FMT_BGR666:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1270  		buf[0][offset] = (b_v << 2) | (g_u_s >> 4);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1271  		buf[0][offset + 1] = (g_u_s << 4) | (r_y_h >> 2);
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1272  		buf[0][offset + 2] = r_y_h << 6;
68cd4e9f21 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1273  		buf[0][offset + 3] = 0;
68cd4e9f21 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13  1274  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1275  	case V4L2_PIX_FMT_RGB32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1276  	case V4L2_PIX_FMT_XRGB32:
54fb153483 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1277  	case V4L2_PIX_FMT_HSV32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1278  	case V4L2_PIX_FMT_XYUV32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1279  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1280  		/* fall through */
628821c84e drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-13 @1281  	case V4L2_PIX_FMT_YUV32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1282  	case V4L2_PIX_FMT_ARGB32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07 @1283  	case V4L2_PIX_FMT_YUV32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1284  	case V4L2_PIX_FMT_AYUV32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1285  		buf[0][offset] = alpha;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1286  		buf[0][offset + 1] = r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1287  		buf[0][offset + 2] = g_u_s;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1288  		buf[0][offset + 3] = b_v;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1289  		break;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1290  	case V4L2_PIX_FMT_BGR32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1291  	case V4L2_PIX_FMT_XBGR32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1292  	case V4L2_PIX_FMT_VUYX32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1293  		alpha = 0;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1294  		/* fall through */
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1295  	case V4L2_PIX_FMT_ABGR32:
5796e67411 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Vivek Kasireddy         2019-02-07  1296  	case V4L2_PIX_FMT_VUYA32:
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1297  		buf[0][offset] = b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1298  		buf[0][offset + 1] = g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1299  		buf[0][offset + 2] = r_y_h;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1300  		buf[0][offset + 3] = alpha;
63881df94d drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2014-08-25  1301  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1302  	case V4L2_PIX_FMT_SBGGR8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1303  		buf[0][offset] = odd ? g_u_s : b_v;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1304  		buf[1][offset] = odd ? r_y_h : g_u_s;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1305  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1306  	case V4L2_PIX_FMT_SGBRG8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1307  		buf[0][offset] = odd ? b_v : g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1308  		buf[1][offset] = odd ? g_u_s : r_y_h;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1309  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1310  	case V4L2_PIX_FMT_SGRBG8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1311  		buf[0][offset] = odd ? r_y_h : g_u_s;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1312  		buf[1][offset] = odd ? g_u_s : b_v;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1313  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1314  	case V4L2_PIX_FMT_SRGGB8:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1315  		buf[0][offset] = odd ? g_u_s : r_y_h;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1316  		buf[1][offset] = odd ? b_v : g_u_s;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1317  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1318  	case V4L2_PIX_FMT_SBGGR10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1319  		buf[0][offset] = odd ? g_u_s << 2 : b_v << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1320  		buf[0][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1321  		buf[1][offset] = odd ? r_y_h << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1322  		buf[1][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1323  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1324  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1325  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1326  	case V4L2_PIX_FMT_SGBRG10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1327  		buf[0][offset] = odd ? b_v << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1328  		buf[0][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1329  		buf[1][offset] = odd ? g_u_s << 2 : r_y_h << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1330  		buf[1][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1331  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1332  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1333  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1334  	case V4L2_PIX_FMT_SGRBG10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1335  		buf[0][offset] = odd ? r_y_h << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1336  		buf[0][offset + 1] = odd ? r_y_h >> 6 : g_u_s >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1337  		buf[1][offset] = odd ? g_u_s << 2 : b_v << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1338  		buf[1][offset + 1] = odd ? g_u_s >> 6 : b_v >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1339  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1340  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1341  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1342  	case V4L2_PIX_FMT_SRGGB10:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1343  		buf[0][offset] = odd ? g_u_s << 2 : r_y_h << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1344  		buf[0][offset + 1] = odd ? g_u_s >> 6 : r_y_h >> 6;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1345  		buf[1][offset] = odd ? b_v << 2 : g_u_s << 2;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1346  		buf[1][offset + 1] = odd ? b_v >> 6 : g_u_s >> 6;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1347  		buf[0][offset] |= (buf[0][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1348  		buf[1][offset] |= (buf[1][offset] >> 2) & 3;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1349  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1350  	case V4L2_PIX_FMT_SBGGR12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1351  		buf[0][offset] = odd ? g_u_s << 4 : b_v << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1352  		buf[0][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1353  		buf[1][offset] = odd ? r_y_h << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1354  		buf[1][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1355  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1356  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1357  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1358  	case V4L2_PIX_FMT_SGBRG12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1359  		buf[0][offset] = odd ? b_v << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1360  		buf[0][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1361  		buf[1][offset] = odd ? g_u_s << 4 : r_y_h << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1362  		buf[1][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1363  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1364  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1365  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1366  	case V4L2_PIX_FMT_SGRBG12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1367  		buf[0][offset] = odd ? r_y_h << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1368  		buf[0][offset + 1] = odd ? r_y_h >> 4 : g_u_s >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1369  		buf[1][offset] = odd ? g_u_s << 4 : b_v << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1370  		buf[1][offset + 1] = odd ? g_u_s >> 4 : b_v >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1371  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1372  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1373  		break;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1374  	case V4L2_PIX_FMT_SRGGB12:
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1375  		buf[0][offset] = odd ? g_u_s << 4 : r_y_h << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1376  		buf[0][offset + 1] = odd ? g_u_s >> 4 : r_y_h >> 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1377  		buf[1][offset] = odd ? b_v << 4 : g_u_s << 4;
25e9007349 drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Ricardo Ribalda Delgado 2016-07-15  1378  		buf[1][offset + 1] = odd ? b_v >> 4 : g_u_s >> 4;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1379  		buf[0][offset] |= (buf[0][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1380  		buf[1][offset] |= (buf[1][offset] >> 4) & 0xf;
b96c544f44 drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-09-21  1381  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1382  	case V4L2_PIX_FMT_SBGGR16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1383  		buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : b_v;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1384  		buf[1][offset] = buf[1][offset + 1] = odd ? r_y_h : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1385  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1386  	case V4L2_PIX_FMT_SGBRG16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1387  		buf[0][offset] = buf[0][offset + 1] = odd ? b_v : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1388  		buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : r_y_h;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1389  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1390  	case V4L2_PIX_FMT_SGRBG16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1391  		buf[0][offset] = buf[0][offset + 1] = odd ? r_y_h : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1392  		buf[1][offset] = buf[1][offset + 1] = odd ? g_u_s : b_v;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1393  		break;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1394  	case V4L2_PIX_FMT_SRGGB16:
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1395  		buf[0][offset] = buf[0][offset + 1] = odd ? g_u_s : r_y_h;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1396  		buf[1][offset] = buf[1][offset + 1] = odd ? b_v : g_u_s;
9b48daa7bb drivers/media/common/v4l2-tpg/v4l2-tpg-core.c Bård Eirik Winther      2018-10-08  1397  		break;
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1398  	}
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1399  }
02aa769d9f drivers/media/platform/vivid/vivid-tpg.c      Hans Verkuil            2015-03-14  1400  

:::::: The code at line 1281 was first introduced by commit
:::::: 628821c84e9047bffab8357668a6b1ef6c0038a5 [media] vivid: add support for packed YUV formats

:::::: TO: Hans Verkuil <hans.verkuil@cisco.com>
:::::: CC: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox series

Patch

diff --git a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
index d9a590ae7545..fa3d40a1c935 100644
--- a/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
+++ b/drivers/media/common/v4l2-tpg/v4l2-tpg-core.c
@@ -246,6 +246,10 @@  bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_YUV555:
 	case V4L2_PIX_FMT_YUV565:
 	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
+	case V4L2_PIX_FMT_XYUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 		tpg->color_enc = TGP_COLOR_ENC_YCBCR;
 		break;
 	case V4L2_PIX_FMT_YUV420M:
@@ -372,6 +376,10 @@  bool tpg_s_fourcc(struct tpg_data *tpg, u32 fourcc)
 	case V4L2_PIX_FMT_ARGB32:
 	case V4L2_PIX_FMT_ABGR32:
 	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
+	case V4L2_PIX_FMT_XYUV32:
+	case V4L2_PIX_FMT_VUYA32:
+	case V4L2_PIX_FMT_VUYX32:
 	case V4L2_PIX_FMT_HSV32:
 		tpg->twopixelsize[0] = 2 * 4;
 		break;
@@ -1267,10 +1275,13 @@  static void gen_twopix(struct tpg_data *tpg,
 	case V4L2_PIX_FMT_RGB32:
 	case V4L2_PIX_FMT_XRGB32:
 	case V4L2_PIX_FMT_HSV32:
+	case V4L2_PIX_FMT_XYUV32:
 		alpha = 0;
 		/* fall through */
 	case V4L2_PIX_FMT_YUV32:
 	case V4L2_PIX_FMT_ARGB32:
+	case V4L2_PIX_FMT_YUV32:
+	case V4L2_PIX_FMT_AYUV32:
 		buf[0][offset] = alpha;
 		buf[0][offset + 1] = r_y_h;
 		buf[0][offset + 2] = g_u_s;
@@ -1278,9 +1289,11 @@  static void gen_twopix(struct tpg_data *tpg,
 		break;
 	case V4L2_PIX_FMT_BGR32:
 	case V4L2_PIX_FMT_XBGR32:
+	case V4L2_PIX_FMT_VUYX32:
 		alpha = 0;
 		/* fall through */
 	case V4L2_PIX_FMT_ABGR32:
+	case V4L2_PIX_FMT_VUYA32:
 		buf[0][offset] = b_v;
 		buf[0][offset + 1] = g_u_s;
 		buf[0][offset + 2] = r_y_h;