Received: by 10.213.65.68 with SMTP id h4csp3599127imn; Tue, 10 Apr 2018 01:21:16 -0700 (PDT) X-Google-Smtp-Source: AIpwx48+AVBtQNaDd7+t+2+Bx2U0ANHTY6/Aa6zscvJCZXyRlSFzthsR9c3LsN9XULBDYcgczkHl X-Received: by 2002:a17:902:8d97:: with SMTP id v23-v6mr41550394plo.285.1523348476806; Tue, 10 Apr 2018 01:21:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523348476; cv=none; d=google.com; s=arc-20160816; b=bY0nC656h0D0gX5iXBcmHVXfOMzyQEMvX3hqZqeDg5mzDlFie85zpwKuvQrdY1CQnM pIJmBqRDMheHp1wRHJTKaCTSqaqhZDyRcOq6szlU/jdWNXMdu5fIJ/2dxN+ejpIVYEzY Bpi9JpaNcv58KvF2xfIQKQYl0s+YTekqayZcuLrcLnmqI48jCqhXLAK/47jVH6CXSi7V gYpNjyiz8piz0GdHkg2pyrscoF6UMvU+TVHNrOsNKG0PV2jko8zcKV4edd2FkozZ1rGF wB2nzJX98A9S70U38X9fvFlR/Oe/ug/hAlL1p52aQO1CdfbHLWHg6fBOhBaT5RDmYbgb zmiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature:arc-authentication-results; bh=HJFOLdXsLPWj0dLLvwu3Amd+7T1q9OCSHsXd2iwtUuQ=; b=gA2Ik7ObkHQtVEQ1yIU78+TF+FGIS2HX+xcyx8ZWHeE55nzE7lVlDpwaFf+qk24wLi N2Bo2vNShss0OzRsxsBsuJFD86DABtW8xE/63yAWI4lvUlsZz1pu241ylcmUHyJIZ4x6 xpsGSWSFTo0nsFh6ovL7s3l/teAEZ0CxU1Y8++h+SkbMW+hyWALY8CHOFTJsaF3XX1G7 jshczxjr6FrzUSuPoVnd55dg0uKMDzkdvqRzuFu9kACbxdeh5x4Dv5Fd66JxvCyKxSV7 h8txxp1ro6DvNq9ffb2pwBtDYeWGQs4M9RJhaVFY2bWJY3ySQYWo+OM2nHmBAfUkL2TO 0hCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@displaylink.com header.s=mimecast20151025 header.b=u+GuaVc+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y5si1652043pfe.184.2018.04.10.01.20.39; Tue, 10 Apr 2018 01:21:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@displaylink.com header.s=mimecast20151025 header.b=u+GuaVc+; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752486AbeDJIRL (ORCPT + 99 others); Tue, 10 Apr 2018 04:17:11 -0400 Received: from eu-smtp-delivery-167.mimecast.com ([207.82.80.167]:51502 "EHLO eu-smtp-delivery-167.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752330AbeDJIRJ (ORCPT ); Tue, 10 Apr 2018 04:17:09 -0400 X-Greylist: delayed 308 seconds by postgrey-1.27 at vger.kernel.org; Tue, 10 Apr 2018 04:17:09 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=displaylink.com; s=mimecast20151025; t=1523348227; h=from:subject:date:message-id:to:cc:mime-version:content-type:content-transfer-encoding:in-reply-to:references; bh=HJFOLdXsLPWj0dLLvwu3Amd+7T1q9OCSHsXd2iwtUuQ=; b=u+GuaVc+garFX/ulScOtnLP8eAH88rxnqKUdx/x+DLqyOAEvmuGOkJwvg/EnQWvKomMvZcd8HP6ETGiPhQLvlq0VUAhC5zVMLS91fvy/Pp73KC+5EVfr381pc3+rqqNFLqDewCB99uV5Kwk3dJ0IVpda78RRLZN+1Stx2otAOso= Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01lp0244.outbound.protection.outlook.com [213.199.154.244]) (Using TLS) by eu-smtp-1.mimecast.com with ESMTP id uk-mta-127-Btv7ezxzN06NdcplPlmPjA-1; Tue, 10 Apr 2018 09:10:55 +0100 Received: from [192.168.48.192] (85.14.102.90) by AM5PR0701MB2914.eurprd07.prod.outlook.com (2603:10a6:203:47::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.675.3; Tue, 10 Apr 2018 08:10:45 +0000 Subject: Re: [RFC 1/3] drm: Add DAMAGE_CLIPS property to plane To: Deepak Rawat , "dri-devel@lists.freedesktop.org" , "thellstrom@vmware.com" , "syeh@vmware.com" CC: "linux-graphics-maintainer@vmware.com" , "daniel@ffwll.ch" , "ville.syrjala@linux.intel.com" , "noralf@tronnes.org" , "robdclark@gmail.com" , "gustavo@padovan.org" , "maarten.lankhorst@linux.intel.com" , "seanpaul@chromium.org" , "airlied@linux.ie" , "linux-kernel@vger.kernel.org" References: <1522885748-67122-1-git-send-email-drawat@vmware.com> <1522885748-67122-2-git-send-email-drawat@vmware.com> From: Lukasz Spintzyk Message-ID: <0e7c70bc-6587-41ea-263a-68018bcb7db2@displaylink.com> Date: Tue, 10 Apr 2018 10:10:40 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <1522885748-67122-2-git-send-email-drawat@vmware.com> Content-Language: en-US X-Originating-IP: [85.14.102.90] X-ClientProxiedBy: VI1PR0102CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:802::16) To AM5PR0701MB2914.eurprd07.prod.outlook.com (2603:10a6:203:47::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dcdeb224-807f-49a0-7554-08d59eba9037 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(7021125)(5600026)(4604075)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(2017052603328)(7153060)(7193020);SRVR:AM5PR0701MB2914; X-Microsoft-Exchange-Diagnostics: 1;AM5PR0701MB2914;3:j053N80pUzjfK853IJG1y3dIjF5sDxkbzMCEnA3f3dmxHhsGOPL2M9rdEZE7NgxtROJT8XAwQEDnKATbdzpjipPErIE2+1mUCxW+PuKUjidY7/Og+kalBMRu3Da11ZCECncQG1f3MDss0L2SgUSPKc0BE1BNcnrwxtapYuH6+xvzozcLbfO0y0tT+7uHHsdDnYGgNRi34ftSN/Nz5R1nwqRM+ElthIhwPYVciLsfelnyOI6cgd/LLjMvV/Ssqpyb;25:Xcbu+Ja0a9Zzy5is+PnJXJpnEm1BzUoyXPrMmrd0ael05dhRHUd+IDwDRlrygFuWblnILZJVNzgV3q6zZSEK1pdZDibuhDidV5r/7hZeZnsJKmK5R87PQoStjDOm02BVn5MbzZd9yeXO3L2kyz93u6vUOLQTP/rPHkZbTt34oCorrkpbR0nicicilnRU4OLFRsvZRY0iArVrnYdwYaS1/kB4k0LCo6gV1lRYV70oD/5ZYajFIqfuNynyhpXsxaYG6tDK3y4QNHoWGDKnNk3krRP5I6IAMD+W21wctRT+aF5A2zxqbP5lkXl55jne4ALA9Xztf3yppIJ4GYAuwfcU+g==;31:tQgOBNfBtiimg4VjiBnyw51bxAsbvER6BoLqbCqdnv7MEpnVeKZIEV7ckHaPHgoaA32O1jF0of55po9Lzn+5PyBch5h8Rvvu2SldocedhPVE5r8aGIZeX0lauEg/go1TZhhBag31QDWO1OHCPFo6PT5L0T87bt7Tc+jabPtJRXCJV2vltTIfnP+2F74nOOvKrh9NFqqBexBunnRnPElMCPgU9fD2CUPEAt/vq/Qrk2w= X-MS-TrafficTypeDiagnostic: AM5PR0701MB2914: X-Microsoft-Exchange-Diagnostics: 1;AM5PR0701MB2914;20:N20ntwjSwY3ntlEEsVmgyz4TiS4h/mYRyBM7vcEWq16lT8Ektv4Nch2mAc/BhEXZE4uW3ThpmnP19eaHOqzVstmPw2LLcwSpLWC06PW77IBInFbxACdGp61LLKyqU7s11Ic3h2ntIjgRfG4EyC7ahXmrUdO5iQLKPydNDWKGDClCXQdJiJPwoJFKtfFWSyITFWPZddYUUoMTMEgU9gVdafiwtENnI1LkzlP297btEtEf5N5V1ja31Ed+JG+hh0ShUsXQye5qrzGqe+tJQdSZ5fBzNgqgQ2hazfMCNFxdyf2o5dPFUF/i50OA4XJsqT37WhKJvHaQ/vGoubQ9tsS5ZJCBecLhrxy5JmqmXKmOcmdP/B+4Y05LNNb0vVGLE4rMy2qTOoA3pXguBYWjjIk/WvedmXdHMtncwq0zhKVoHZ7ehigQWEtdXIM5KF0HnKzbZwHfj4612in09SQr+zw7WWjPg/ulLBtEHCn9u70xm9FdsJWiRanPiRqlmBRDhCtC;4:XD6NSmaM6l9QTpGNQwfeXx9uePbbGkpue1ipBtMT2HpivEkzhBNJMfkpOnmG2gYBzMMdplodwHIvbYCbbEaR0V6lmXvujRQh/xBgWmbAwWduYstFMY+vnV4xkoGEMSHCvj6UBvJUwVuT/gxooOix7+312jUif1Ur0Gaz3SSL+WQA4NwX9nZrz5ACSK/ERCbbwzwoV7AvA/4tJqfpYMtgQhdLLsCH/LWykS7mXO2/XbH/r1GvkoyqmRWO+I4u4uv8YdUBzOV2Cesp+0GTzCf3Ql8QvTjnr4RYxdZDJGFYXAu5aPohtTITrpJabYWHPWqQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(3231221)(944501327)(52105095)(10201501046)(6041310)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(2016111802025)(6072148)(6043046)(201708071742011);SRVR:AM5PR0701MB2914;BCL:0;PCL:0;RULEID:;SRVR:AM5PR0701MB2914; X-Forefront-PRVS: 0638FD5066 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6049001)(39380400002)(376002)(346002)(366004)(39850400004)(396003)(189003)(199004)(6116002)(68736007)(3846002)(50466002)(81156014)(4326008)(31686004)(6246003)(8936002)(229853002)(65956001)(478600001)(956004)(117156002)(81166006)(11346002)(2906002)(58126008)(476003)(47776003)(2616005)(8676002)(59450400001)(52116002)(76176011)(386003)(25786009)(3260700006)(2870700001)(66066001)(67846002)(486006)(64126003)(53546011)(65806001)(305945005)(97736004)(7736002)(54906003)(6486002)(110136005)(31696002)(86362001)(65826007)(7416002)(2201001)(575784001)(5660300001)(6666003)(316002)(53936002)(106356001)(77096007)(186003)(105586002)(16576012)(23746002)(16526019)(36756003)(39060400002)(5890100001)(2501003)(26005)(446003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM5PR0701MB2914;H:[192.168.48.192];FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM5PR0701MB2914;23:ONQV0VHsTI3r8WK8LNyegpTz9olI7/u/LwBmKKt?= =?us-ascii?Q?a4JdZdcHV8KDyinsvjKOmQY9Q/W5UJ+W8efb8PzNvAKIZHdn+OSjGz2Y6UeW?= =?us-ascii?Q?DX0lHuafvFM/Wtaq90LbpFn7TtwcT6OJpwwepPC+RFlg+L372W7XllJwaI09?= =?us-ascii?Q?0gmnLvpLZiLzAvYWoArXnXeNgnOS/g78doxqKvXYcxZaGejqD7nw4YcAxUEg?= =?us-ascii?Q?qy1O7v9q/VhSN7coJ1hmKj9JkI0gRLWZPHBMvRRvAkhB5HRt8tGwZ6wDqqqt?= =?us-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c3Ca+Dr6VNTvquvqxUhlEV/Dl0ZSD83NENpniWeRQiqjguDSrVCCdN1JaCuvf8c14bZHw/LUebyClSAzhqlBb/em4EyLi2Cw9Iw78qJBBea3+oyrYCMs6+dClamhCAyLbncfkZikeltlcnSVM1wYxNT87iTr9aIZ8jvpWRmgB13O6iNofZrb6S2VwxAhqJSUw2xKWFT7DdN8esteq6VDxzPEPeQTZOyfv3s2tPVl5vMDQvi5H3VckFvjIbfy2znFWA==;5:lYNEzOwnLSGiG3+4Rz6B1fu4RNOBPRHFh187oydN0dJqoImHP9SogC1f8dAzGeUQ4IJUyQzT4z0NRm/79/VSnAzhgXEdlCy7cAbB3IRSKbiMEA9Y1iR4ezLT1po6p/MiUa7Ae2bnU4qCRsf5bpURKfMKgBr+ol0fuJoi08PInWU=;24:5fU9baeZrrtP7eJKASp+P4yQ8Zrhq0aDEUHYVlKbOLycNGcrvKQu5f92p23QeCKgPjJUDk9KcSZU0mgK4B6q9QkuaW1pXNZsWPy21rBrbqs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;AM5PR0701MB2914;7:3tV/wArMaFMx+GsaoeiMasE38Ku2tFpK4rtLD2ybHjOL00WasLxgXM3GpwiVaTBXE6JAjdV73ptOIOvpizbVllmEMg4OFepWdGrU5j5B/NaXjKz/4wYJn57exwgLdPOC5Exxj3O07OaCm0gxo0IXWYER3kFUCflUm6gpiOIYvA0Mug/PTLIbW3LVp7pXwMLxY5eYAhQF2GSc37mcedGAdXyM9w4UqUk5QHBK96SHHLDjpC8wqtupziyoUfIcmDCr;20:WVXbxdWKmA02AMCBK24y1nt5BjtR4/BNGH6EKPnKhNsQcP52c87G4oXF/BB6YeT+5ReobGMZcIWx1p7cKR+EnZiJNjmTLFT4hZsZmZPFjBjZo8DI7uomt3NUWiKqjddZ5vyJG0x0mX9+YEopTfXZ1vQe04s43OySLRbMISFTIv4= X-OriginatorOrg: displaylink.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Apr 2018 08:10:45.1802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dcdeb224-807f-49a0-7554-08d59eba9037 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a4bda75a-b444-4312-9c90-44a7c4b2c91a X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0701MB2914 X-MC-Unique: Btv7ezxzN06NdcplPlmPjA-1 Content-Type: text/plain; charset=WINDOWS-1252; format=flowed Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/04/2018 01:49, Deepak Rawat wrote: > From: Lukasz Spintzyk > > Optional plane property to mark damaged regions on the plane in > framebuffer coordinates of the framebuffer attached to the plane. > > The layout of blob data is simply an array of drm_mode_rect with maximum > array size limited by DRM_MODE_FB_DIRTY_MAX_CLIPS. Unlike plane src > coordinates, damage clips are not in 16.16 fixed point. > > Damage clips are a hint to kernel as which area of framebuffer has > changed since last page-flip. This should be helpful for some drivers > especially for virtual devices where each framebuffer change needs to > be transmitted over network, usb, etc. > > Driver which are interested in enabling DAMAGE_CLIPS property for a > plane should enable this property using drm_plane_enable_damage_clips. > > Signed-off-by: Lukasz Spintzyk > Signed-off-by: Deepak Rawat > --- > drivers/gpu/drm/drm_atomic.c | 42 ++++++++++++++++++++++++++++++= +++++++ > drivers/gpu/drm/drm_atomic_helper.c | 4 ++++ > drivers/gpu/drm/drm_mode_config.c | 5 +++++ > drivers/gpu/drm/drm_plane.c | 12 +++++++++++ > include/drm/drm_mode_config.h | 15 +++++++++++++ > include/drm/drm_plane.h | 16 ++++++++++++++ > include/uapi/drm/drm_mode.h | 15 +++++++++++++ > 7 files changed, 109 insertions(+) > > diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c > index 7d25c42..9226d24 100644 > --- a/drivers/gpu/drm/drm_atomic.c > +++ b/drivers/gpu/drm/drm_atomic.c > @@ -669,6 +669,40 @@ static void drm_atomic_crtc_print_state(struct drm_p= rinter *p, > } > =20 > /** > + * drm_atomic_set_damage_for_plane - sets the damage clips property to p= lane > + * @state: plane state > + * @blob: damage clips in framebuffer coordinates > + * > + * Returns: > + * > + * Zero on success, error code on failure. > + */ > +static int drm_atomic_set_damage_for_plane(struct drm_plane_state *state= , > +=09=09=09=09=09 struct drm_property_blob *blob) > +{ > +=09if (blob =3D=3D state->damage_clips) > +=09=09return 0; > + > +=09drm_property_blob_put(state->damage_clips); > +=09state->damage_clips =3D NULL; > + > +=09if (blob) { > +=09=09uint32_t count =3D blob->length/sizeof(struct drm_rect); > + > +=09=09if (count > DRM_MODE_FB_DIRTY_MAX_CLIPS) > +=09=09=09return -EINVAL; > + > +=09=09state->damage_clips =3D drm_property_blob_get(blob); > +=09=09state->num_clips =3D count; > +=09} else { > +=09=09state->damage_clips =3D NULL; > +=09=09state->num_clips =3D 0; > +=09} > + > +=09return 0; > +} > + > +/** > * drm_atomic_get_plane_state - get plane state > * @state: global atomic state object > * @plane: plane to get state object for > @@ -793,6 +827,12 @@ static int drm_atomic_plane_set_property(struct drm_= plane *plane, > =09=09state->color_encoding =3D val; > =09} else if (property =3D=3D plane->color_range_property) { > =09=09state->color_range =3D val; > +=09} else if (property =3D=3D config->prop_damage_clips) { > +=09=09struct drm_property_blob *blob =3D > +=09=09=09drm_property_lookup_blob(dev, val); > +=09=09int ret =3D drm_atomic_set_damage_for_plane(state, blob); > +=09=09drm_property_blob_put(blob); > +=09=09return ret; > =09} else if (plane->funcs->atomic_set_property) { > =09=09return plane->funcs->atomic_set_property(plane, state, > =09=09=09=09property, val); > @@ -856,6 +896,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane= , > =09=09*val =3D state->color_encoding; > =09} else if (property =3D=3D plane->color_range_property) { > =09=09*val =3D state->color_range; > +=09} else if (property =3D=3D config->prop_damage_clips) { > +=09=09*val =3D (state->damage_clips) ? state->damage_clips->base.id : 0; > =09} else if (plane->funcs->atomic_get_property) { > =09=09return plane->funcs->atomic_get_property(plane, state, property, = val); > =09} else { > diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_at= omic_helper.c > index c356545..55b44e3 100644 > --- a/drivers/gpu/drm/drm_atomic_helper.c > +++ b/drivers/gpu/drm/drm_atomic_helper.c > @@ -3506,6 +3506,8 @@ void __drm_atomic_helper_plane_duplicate_state(stru= ct drm_plane *plane, > =20 > =09state->fence =3D NULL; > =09state->commit =3D NULL; > +=09state->damage_clips =3D NULL; > +=09state->num_clips =3D 0; > } > EXPORT_SYMBOL(__drm_atomic_helper_plane_duplicate_state); > =20 > @@ -3550,6 +3552,8 @@ void __drm_atomic_helper_plane_destroy_state(struct= drm_plane_state *state) > =20 > =09if (state->commit) > =09=09drm_crtc_commit_put(state->commit); > + > +=09drm_property_blob_put(state->damage_clips); > } > EXPORT_SYMBOL(__drm_atomic_helper_plane_destroy_state); > =20 > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode= _config.c > index e5c6533..e93b127 100644 > --- a/drivers/gpu/drm/drm_mode_config.c > +++ b/drivers/gpu/drm/drm_mode_config.c > @@ -293,6 +293,11 @@ static int drm_mode_create_standard_properties(struc= t drm_device *dev) > =09=09return -ENOMEM; > =09dev->mode_config.prop_crtc_id =3D prop; > =20 > +=09prop =3D drm_property_create(dev, DRM_MODE_PROP_BLOB, "DAMAGE_CLIPS",= 0); > +=09if (!prop) > +=09=09return -ENOMEM; > +=09dev->mode_config.prop_damage_clips =3D prop; > + > =09prop =3D drm_property_create_bool(dev, DRM_MODE_PROP_ATOMIC, > =09=09=09"ACTIVE"); > =09if (!prop) > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c > index 6d2a6e4..071221b 100644 > --- a/drivers/gpu/drm/drm_plane.c > +++ b/drivers/gpu/drm/drm_plane.c > @@ -1101,3 +1101,15 @@ int drm_mode_page_flip_ioctl(struct drm_device *de= v, > =20 > =09return ret; > } > + > +/** > + * drm_plane_enable_damage_clips - enable damage clips property > + * @plane: plane on which this property to enable. > + */ > +void drm_plane_enable_damage_clips(struct drm_plane *plane) > +{ > +=09struct drm_device *dev =3D plane->dev; > +=09struct drm_mode_config *config =3D &dev->mode_config; > + > +=09drm_object_attach_property(&plane->base, config->prop_damage_clips, 0= ); > +} > diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.= h > index 7569f22..d8767da 100644 > --- a/include/drm/drm_mode_config.h > +++ b/include/drm/drm_mode_config.h > @@ -628,6 +628,21 @@ struct drm_mode_config { > =09 */ > =09struct drm_property *prop_crtc_id; > =09/** > +=09 * @prop_damage_clips: Optional plane property to mark damaged region= s > +=09 * on the plane in framebuffer coordinates of the framebuffer attache= d > +=09 * to the plane. > +=09 * > +=09 * The layout of blob data is simply an array of drm_mode_rect with > +=09 * maximum array size limited by DRM_MODE_FB_DIRTY_MAX_CLIPS. Unlike > +=09 * plane src coordinates, damage clips are not in 16.16 fixed point. > +=09 * > +=09 * Damage clips are a hint to kernel as which area of framebuffer has > +=09 * changed since last page-flip. This should be helpful > +=09 * for some drivers especially for virtual devices where each > +=09 * framebuffer change needs to be transmitted over network, usb, etc. > +=09 */ > +=09struct drm_property *prop_damage_clips; > +=09/** > =09 * @prop_active: Default atomic CRTC property to control the active > =09 * state, which is the simplified implementation for DPMS in atomic > =09 * drivers. > diff --git a/include/drm/drm_plane.h b/include/drm/drm_plane.h > index f7bf4a4..9f24548 100644 > --- a/include/drm/drm_plane.h > +++ b/include/drm/drm_plane.h > @@ -146,6 +146,21 @@ struct drm_plane_state { > =09 */ > =09struct drm_crtc_commit *commit; > =20 > +=09/* > +=09 * @damage_clips > +=09 * > +=09 * blob property with damage as array of drm_rect in framebuffer > +=09 * coodinates. > +=09 */ > +=09struct drm_property_blob *damage_clips; > + > +=09/* > +=09 * @num_clips > +=09 * > +=09 * Number of drm_rect in @damage_clips. > +=09 */ > +=09uint32_t num_clips; > + > =09struct drm_atomic_state *state; > }; > =20 > @@ -611,6 +626,7 @@ int drm_plane_init(struct drm_device *dev, > =09=09 const uint32_t *formats, unsigned int format_count, > =09=09 bool is_primary); > void drm_plane_cleanup(struct drm_plane *plane); > +void drm_plane_enable_damage_clips(struct drm_plane *plane); > =20 > /** > * drm_plane_index - find the index of a registered plane > diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h > index 50bcf42..0ad0d5b 100644 > --- a/include/uapi/drm/drm_mode.h > +++ b/include/uapi/drm/drm_mode.h > @@ -873,6 +873,21 @@ struct drm_mode_revoke_lease { > =09__u32 lessee_id; > }; > =20 > +/** > + * struct drm_mode_rect - two dimensional rectangle drm_rect exported to > + * user-space. > + * @x1: horizontal starting coordinate (inclusive) > + * @y1: vertical starting coordinate (inclusive) > + * @x2: horizontal ending coordinate (exclusive) > + * @y2: vertical ending coordinate (exclusive) > + */ > +struct drm_mode_rect { > +=09__s32 x1; > +=09__s32 y1; > +=09__s32 x2; > +=09__s32 y2; > +}; I wonder why we can't use move 'struct drm_rect'=A0 definition from=20 'include/drm/drm_rect.h' and include 'uapi/drm/drm_mode.h' in private header=20 'include/drm/drm_rect.h'. Is there any general rule that disallows it? > + > #if defined(__cplusplus) > } > #endif