[PATCH libdrm 8/8] proptest: support plane properties
Rob Clark
rob.clark at linaro.org
Thu Jun 7 07:45:59 PDT 2012
On Thu, Jun 7, 2012 at 1:09 PM, Joonyoung Shim <jy0922.shim at samsung.com> wrote:
> Hi, Rob.
>
>
> On 06/06/2012 03:06 AM, Rob Clark wrote:
>>
>> From: Rob Clark<rob at ti.com>
>>
>> Add support to display plane properties.
>
>
> Do you not support to set property for plane?
oh, heh, I missed the fact that proptest actually lets you *set*
properties.. I won't push this particular patch until I update it to
set properties too
BR,
-R
>
>>
>> Signed-off-by: Rob Clark<rob at ti.com>
>> ---
>> tests/proptest/proptest.c | 32 ++++++++++++++++++++++++++++++++
>> 1 file changed, 32 insertions(+)
>>
>> diff --git a/tests/proptest/proptest.c b/tests/proptest/proptest.c
>> index fa34a48..aac6b8f 100644
>> --- a/tests/proptest/proptest.c
>> +++ b/tests/proptest/proptest.c
>> @@ -39,6 +39,7 @@
>>
>> int fd;
>> drmModeResPtr res = NULL;
>> +drmModePlaneResPtr plane_res = NULL;
>>
>> const char *connector_type_str(uint32_t type)
>> {
>> @@ -239,10 +240,33 @@ static void listCrtcProperties(void)
>> }
>> }
>>
>> +static void listPlaneProperties(void)
>> +{
>> + int i;
>> + drmModePlanePtr p;
>> +
>> + for (i = 0; i< plane_res->count_planes; i++) {
>> + p = drmModeGetPlane(fd, plane_res->planes[i]);
>> +
>> + if (!p) {
>> + fprintf(stderr, "Could not get plane %u: %s\n",
>> + plane_res->planes[i], strerror(errno));
>> + continue;
>> + }
>> +
>> + printf("Plane %u\n", p->plane_id);
>> +
>> + listObjectProperties(p->plane_id, DRM_MODE_OBJECT_PLANE);
>> +
>> + drmModeFreePlane(p);
>> + }
>> +}
>> +
>> static void listAllProperties(void)
>> {
>> listConnectorProperties();
>> listCrtcProperties();
>> + listPlaneProperties();
>> }
>>
>> static int setProperty(char *argv[])
>> @@ -309,6 +333,14 @@ int main(int argc, char *argv[])
>> goto done;
>> }
>>
>> + plane_res = drmModeGetPlaneResources(fd);
>> + if (!plane_res) {
>> + fprintf(stderr, "Failed to get plane resources: %s\n",
>> + strerror(errno));
>> + ret = 1;
>> + goto done;
>> + }
>> +
>> if (argc< 2) {
>> listAllProperties();
>> } else if (argc == 5) {
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
More information about the dri-devel
mailing list