xref: /OK3568_Linux_fs/u-boot/test/rockchip/test-display.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * (C) Copyright 2019 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #include <common.h>
8 #include <video_rockchip.h>
9 #include "test-rockchip.h"
10 
11 #ifdef CONFIG_DRM_ROCKCHIP
do_test_display(cmd_tbl_t * cmdtp,int flag,int argc,char * const argv[])12 int do_test_display(cmd_tbl_t *cmdtp, int flag, int argc, char *const argv[])
13 {
14 	int ret = 0;
15 
16 	ret |= rockchip_show_logo();
17 	mdelay(2000);
18 	ret |= rockchip_show_bmp("logo.bmp");
19 	mdelay(2000);
20 	ret |= rockchip_show_bmp("logo_kernel.bmp");
21 	mdelay(2000);
22 
23 	ut_err("display: failed to show bmp\n");
24 
25 	return ret;
26 }
27 
28 static cmd_tbl_t sub_cmd[] = {
29 	UNIT_CMD_DEFINE(display, 0),
30 };
31 
32 static const char sub_cmd_help[] =
33 "    [.] rktest display                     - test display\n"
34 ;
35 
36 const struct cmd_group cmd_grp_display = {
37 	.id	= TEST_ID_DISPLAY,
38 	.help	= sub_cmd_help,
39 	.cmd	= sub_cmd,
40 	.cmd_n	= ARRAY_SIZE(sub_cmd),
41 };
42 #else
43 const struct cmd_group cmd_grp_display = {
44 	.id	= TEST_ID_DISPLAY,
45 	.help	= NULL,
46 	.cmd	= NULL,
47 	.cmd_n	= 0,
48 };
49 #endif
50