使用的rk3568, 接了dsi竖屏:
163 162 connected DSI-1 0x0 1 162
modes:
name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
1080x1920 62 1080 1116 1120 1150 1920 1926 1928 1934 138000 flags: nhsync, nvsync; type: preferred, driver
有支持rotate的plane,这个plane如何使用?如果我设置roate 90或270后,是不是可以将横屏的1920x1080数据,直接发送到竖屏(1080x1920)上进行显示?
目前rotate操作是调用opencl 旋转后送到竖屏drm显示的。
131 0 0 0,0 0,0 0 0x00000003
formats: XR24 AR24 XB24 AB24 RG24 BG24 RG16 BG16 NV12 NV16 NV24 NA12 NA16 NA24
props:
8 type:
flags: immutable enum
enums: Overlay=0 Primary=1 Cursor=2
value: 0
30 IN_FORMATS:
flags: immutable blob
blobs:
value:
01000000000000000e00000018000000
0a000000500000005852323441523234
58423234414232345247323442473234
52473136424731364e5631324e563136
4e5632344e4131324e4131364e413234
ff1b0000000000000000000000000000
0100000000000008ff1b000000000000
00000000000000004100000000000008
ff1b0000000000000000000000000000
1100000000000008ff1b000000000000
00000000000000008100000000000008
ff1b0000000000000000000000000000
5100000000000008ff1b000000000000
0000000000000000c100000000000008
ff1b0000000000000000000000000000
9100000000000008ff1b000000000000
0000000000000000d100000000000008
ff1b0000000000000000000000000000
7100000000000008ff3f000000000000
00000000000000000000000000000000
in_formats blob decoded:
XR24: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
AR24: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
XB24: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
AB24: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
RG24: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
BG24: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
RG16: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
BG16: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
NV12: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
NV16: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
NV24: LINEAR
NA12: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
NA16: (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) (UNKNOWN MODIFIER) LINEAR
NA24: LINEAR
133 rotation:
flags: bitmask
values: rotate-0=0x1 rotate-90=0x2 rotate-270=0x8 reflect-x=0x10 reflect-y=0x20
value: 0
134 alpha:
flags: range
values: 0 65535
value: 65535
135 pixel blend mode:
flags: enum
enums: None=2 Pre-multiplied=0 Coverage=1
value: 0
136 zpos:
flags: range
values: 0 7
value: 6
137 NAME:
flags: immutable bitmask
values: Cluster1-win0=0x40
value: 64
138 FEATURE:
flags: immutable bitmask
values: scale=0x1 afbdc=0x10
value: 17
139 INPUT_WIDTH:
flags: immutable range
values: 0 4096
value: 0
140 INPUT_HEIGHT:
flags: immutable range
values: 0 2304
value: 0
141 OUTPUT_WIDTH:
flags: immutable range
values: 0 4096
value: 0
142 OUTPUT_HEIGHT:
flags: immutable range
values: 0 2304
value: 0
143 SCALE_RATE:
flags: immutable range
values: 4 4
value: 0
144 colorkey:
flags: range
values: 0 2164260863
value: 0
离线
没看懂你的需求是啥,如果用的是官方默认的Linux的SDK,输入下面的命令看看;
echo "output:all:rotate90"> /tmp/.weston_drm.conf # All screens are rotated 90 degrees
先说正常情况:竖屏1080x1920的plane,播放视频,需要1080x1920分辨率的。一般视频是1920x1080格式,如果想在竖屏播放,必须rotate后成1080x1920的才可以发送给plane.
需求就是:想通过设置drm plane的rotate属性,比如设置旋转90度,之后向此plane发送1920x1080的视频,此plane是不是就可以“在内部rotate后”,显示到1080x1920的屏幕上?
离线
drmModeObjectSetProperty()
尝试通过这个接口设置支持rotate的plane,但是不行。
void set_plane_property(int fd, int plane_id,struct property_arg *p)
{
drmModeObjectPropertiesPtr props;
drmModePropertyPtr pt;
const char *obj_type;
int ret;
int i;
props = drmModeObjectGetProperties(fd, plane_id,
DRM_MODE_OBJECT_PLANE);
if(props){
for (i = 0; i < (int)props->count_props; ++i) {
pt = drmModeGetProperty(fd, props->props[i]);
if (!pt)
continue;
if (strcmp(pt->name, p->name) == 0){
drmModeFreeProperty(pt);
break;
}
drmModeFreeProperty(pt);
}
if (i == (int)props->count_props) {
printf("%i has no %s property\n",p->obj_id, p->name);
return;
}
p->prop_id = props->props[i];
ret = drmModeObjectSetProperty(fd, p->obj_id, p->obj_type,
p->prop_id, p->value);
if (ret < 0)
printf("faild to set property %s,id %d,value %d\n",p->obj_id, p->name, p->value);
drmModeFreeObjectProperties(props);
}
}
void set_rotation(int fd, int plane_id,int value)
{
struct property_arg prop;
if(value !=1 && value !=2 && value !=4 && value !=8)
return;
memset(&prop, 0, sizeof(prop));
prop.obj_type = 0;
prop.name[DRM_PROP_NAME_LEN] = '\0';
prop.obj_id = plane_id;
memcpy(prop.name,"rotation",sizeof("rotation"));
prop.value = value; //rotate-0=0x1 rotate-90=0x2 rotate-180=0x4 rotate-270=0x8, modetest -p can show the details
set_plane_property(fd,plane_id,&prop);
}
set_rotation(fd,plane_res->planes[index], 0x1);
离线