Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3759710pxf; Mon, 29 Mar 2021 10:35:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxrV5B2FQ00p55BRj5ExGzhagSDvMoopQX6a2dhXP72dZG1JfcJDlbQGe3LAdpPVzlmncxI X-Received: by 2002:aa7:c684:: with SMTP id n4mr15609516edq.141.1617039327403; Mon, 29 Mar 2021 10:35:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617039327; cv=pass; d=google.com; s=arc-20160816; b=eqUSz0vBtm69KM80VX7bOMVVEzTKeZ5mqYmFZbWZKi76xwgC1gBjEcE0zK1zpFKhdB CDhThUx7FjzXJk6ixNkooKw0IP+jwY+6oCVpJaQfBlYLK3Ziij6GZz/mo4lvi54xS75N NaJJp+zbAZUktazHqbIj5TrdDTwyWxCt24duxCMpljNkM4C50z841AEUKY0cdFB8ijKo bgoMcWP9YcPrQ0Ojum6mVZu0HJXWFLc6h0Zbl+s141eluum0aRmQGubPlp957Gtf+umH OggSt+3ekhkKGvom2NPOxdeegR+zM0cKePDtGLOl2VHp6IEyPiJbxYH0o14zgcS7UEKc vgNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:in-reply-to:user-agent:date:message-id:from :references:cc:to:subject:dkim-signature; bh=vRl4CM98VnUwsjuPkji+ebpOYEO0wzKz8YEjuxmTn4c=; b=L4lBIngSG6gv2UKMvIQxMW8eL+vk+bQc/B0IfQ9vlUg4yITtWEOzHg3lFFLnuq4TU0 5UoIfxYwPpwvY5BqWNrdolJXomRGcS9aVHQw182PkJic3B5In6EaW8dSM9gZPcQ5JojS 5TcINcq4eCG6TyoUK+ndRmhHbczczwpnP7LLdMDUHLwjlhCxgSQ0nqTlvn79l9ZiL4Fh +TlTvCk5orAHNV7/wtahNHWiiTkifvhGINvWgNzCl6mSfPFuLKEWfnTsFHHLIdy4veGC oOIwJkAxck6f5CZy58uVLk6CKmMnBvgtpJSuTLD+80FJrrGQExW8blxS6tPFwVP12fA7 KuFg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=EsiIInyB; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amd.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec6si13533804ejb.738.2021.03.29.10.35.04; Mon, 29 Mar 2021 10:35:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=EsiIInyB; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbhC2Rdv (ORCPT + 99 others); Mon, 29 Mar 2021 13:33:51 -0400 Received: from mail-bn8nam12on2063.outbound.protection.outlook.com ([40.107.237.63]:55168 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229479AbhC2Rdt (ORCPT ); Mon, 29 Mar 2021 13:33:49 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AA71YgXi3DVqt5p+qzTUX8gTuZu/UP9hvRYv4LpEYA6TqsZ5C4tD3tF1xBmlFBDgHIm5fhxfEJcwnPfIX9r7tM3HHE5uueo5opo6KmOwwvT1S5oRGfxmPK7vXcapMxk/tx/aRxqKq0mP4nBzdLn9pGzMYZM9a2uM4fmyWZFxYma/MW6fO9qxO61IORst9r+9OJxVRXWHb/wN/EEaznhYM88itWvjHXhq48WpcLbAmMf52aw1/ZHhSafXO+BSUCYcXZpRPOLDdUHCWcKuyTZn1wrZC1I5yvtSEs3UgnPgy+gp5pry7ODNVVgs4VMjUrDjAXqH86V3wAXTNvvRb4nUdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vRl4CM98VnUwsjuPkji+ebpOYEO0wzKz8YEjuxmTn4c=; b=H0bMBkSqaoyxwkigIMha0XbJyi0TAyODZ2rYlmg0V4eNzeJj92OSC0u/sBq33UjlsHtnT0lPvIIx45X0H4nPhibWJawGzR6yc9zweGSVn08JJwvSMu4sn5rthpyU8ebY7fp1onfoaA7EROZqhv2MQRDrV+s+6Egb7QTtN8cEIzSOhaIn698/TaVPr9IRU5MSb1uBEwKSayqpBNbaNdJQxAWv0NjQbQlHko04cGU4PHGPhtdprC2covepD6e+EGv4GLKZNAuf0ktFXFyHPl5xWwFo5rhC6/lMxbhZ4A2p6gNzZ5/p0lHGZ3h6W7jYDlEfG1KQnASbuw4YLQ3xMVwKhw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vRl4CM98VnUwsjuPkji+ebpOYEO0wzKz8YEjuxmTn4c=; b=EsiIInyB9oXONVlk0aAnMvc1REWM07C6ZhavXvpdnmk982Hg9cRarBFJBGOvre87dpIlqzP8Fpjn0/BFeuA2/+Xylu8dD7/PCjkE++u7h1avRWInjqkNeBhMwUxVU4U3c2+GVKmIVmr+JnjuFaOE/F+H95mAMe6HP5xN4PaNHy8= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=amd.com; Received: from MW3PR12MB4379.namprd12.prod.outlook.com (2603:10b6:303:5e::11) by MWHPR1201MB2476.namprd12.prod.outlook.com (2603:10b6:300:de::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.26; Mon, 29 Mar 2021 17:33:45 +0000 Received: from MW3PR12MB4379.namprd12.prod.outlook.com ([fe80::4987:8b2f:78ca:deb8]) by MW3PR12MB4379.namprd12.prod.outlook.com ([fe80::4987:8b2f:78ca:deb8%7]) with mapi id 15.20.3977.033; Mon, 29 Mar 2021 17:33:45 +0000 Subject: Re: [PATCH] drm/amd/display: dual cursors are seen if scaling is enabled To: Louis Li Cc: ching-li@amd.com, Leo Li , Alex Deucher , =?UTF-8?Q?Christian_K=c3=b6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , Nicholas Kazlauskas , Ikshwaku Chauhan , Aric Cyr , hersen wu , =?UTF-8?Q?St=c3=a9phane_Marchesin?= , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20210329075411.501760-1-Ching-shih.Li@amd.com> From: Harry Wentland Message-ID: Date: Mon, 29 Mar 2021 13:33:39 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 In-Reply-To: <20210329075411.501760-1-Ching-shih.Li@amd.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [198.200.67.155] X-ClientProxiedBy: YT1PR01CA0032.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01::45) To MW3PR12MB4379.namprd12.prod.outlook.com (2603:10b6:303:5e::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.1.193] (198.200.67.155) by YT1PR01CA0032.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3977.32 via Frontend Transport; Mon, 29 Mar 2021 17:33:42 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 0a3c9a0e-ea72-4aa6-f9e9-08d8f2d8cd6c X-MS-TrafficTypeDiagnostic: MWHPR1201MB2476: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /e7CwaaydWqXoJt7htMwaZPQyn2xK8x6HkF9idHzLpiX/ZXeYSU8pvsf9OEHNBOq3OjTmHnZbsEFcSBoaUMfMkVv5nz/YHQI2OAs4KjuSUk/iJUasrRpXgCU2mmQwZSipEyJB1CuQuFYqn3K97xYD66h7RjEcSv3IR4dffBA/Pd9c9Zs5RT+6oXg3f9EKvv/dX326RVCm7oHm4e7yThDx9RpdXcoG0LMDdC7uJp/yRruGt1ujxF/VY9DMLwMjMB7F/Ici2Mn+G+Rwvy+625/3qpS7FmSUw93L/JUXQ1Or3WcyP8nVAbYTOD9i7FndfffTP5sULkxN0aaL48JT1uRge0noxPasmYH1VynAgWYtI62MpGX24sCKRlXqI/S2ZORLc8nUjU0KXj3/POXMAicdZK57BTTyV8Rh07P/SRBuAD6BgTu9W6DIwbOHf6z4kme1v+jhb0JHlFyUC46fp8e78YLJLCJH4xhCY1rbAxJkgv5qJBfVMp6G8NnlnmGWX3De60T40incRJ/UNZwGyjirDpuGoMgXsQv9A3OLCoA/ABmhbU5RS6AdPRRD2cJ7qnDb1eH4LHpMzw8yTjRSxEsywjFLEwQrZktEUP+2TG1+qHhV7KBGyfu4bAbAL/C/Pc1xJV2WeOx/Qpdd0H0x2l6Lxjyc3QwnHNCKP/+La+qzIHE2zq6jibpC3/Hy8tOH0XmimZMkoH2YgopxpPesMmf7g31YA1OGUQWsla5wXAATNo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW3PR12MB4379.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(39860400002)(376002)(396003)(366004)(346002)(136003)(66946007)(4326008)(83380400001)(66556008)(8936002)(2616005)(66476007)(36756003)(5660300002)(956004)(16526019)(86362001)(6486002)(6862004)(31686004)(38100700001)(186003)(316002)(54906003)(16576012)(37006003)(44832011)(2906002)(31696002)(53546011)(6666004)(478600001)(26005)(6636002)(8676002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?N002Nm8zUFN3TUJ6RkZqeG5KYmc4S05MYlE1enR3NGE0TnJnaVY2ZFZaQ01x?= =?utf-8?B?MHZGZjh0NW9IeUp1eXBJNkVMYVZkTEdDaldudlZHZW54TXB3ZW1QVTg1azBN?= =?utf-8?B?ajdIcmZTcXhzQ0tuNkhRTEp3RGEzdHFRVlBvcittYXVEbXduRTN5SzVWSHpR?= =?utf-8?B?N2JwU3NLa1dSZmNoV0prRm5laVV4c1JEaGUvSWtvS28yd3Q5VWZ5V20wT3VZ?= =?utf-8?B?OVBUK09RMGhpQ1lSYU9Ubkc0MTZUajRPZkU3Wi9kT2ZaT2c3OVBnVExPL0Vw?= =?utf-8?B?L1dYRGlkQVBHRExQZXdTdkY3bFFkdWFhMFdhTENmTlRDYVVxTGtnVExxUDVJ?= =?utf-8?B?cFpSR2xTTDJEQVJYSEhhRGcwbVZwKy9xaHBMa0dHQTZiSkFKbVhrWFJXTUZl?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RYRlR3VHozaXVXUDhXM0VZTUVC?= =?utf-8?B?U0hmaWUvNld1SU43TTFTUGRhTjlTb0hLWU5nV2FwSEZ4MDNLWEllVk5TVUJv?= =?utf-8?B?eGhjLzBPN0VRQVNybXVzdlllZENUZ005enVML1I2L2VLZFBaZ01PMldwdXFB?= =?utf-8?B?ZGRzcHNMSzZtOEJBdm8xZTM0YjNKaXc2Nkl2YU9MTENhbVRZMWwrOEEvcTZY?= =?utf-8?B?R3JTN3lYaE5tQkNHSDlzRGxJRm9obGJZM1VEOGFOS3NoWERRdEJBVk9PclZL?= =?utf-8?B?WjBIK3dIMkJnSVhTOFM3ZEJ3cnRNVkxxempKVjVKdnhVYWI1eExqdWs0ak9O?= =?utf-8?B?OTRyNk51a0ZuWUhhYUlUYlhqK3VSODhLMnJsUVNTbmFiNytWTXlEek5QZFdp?= =?utf-8?B?TGcwM1FGeWJVTUNGQWRVb0xVOHN2RnUxc3FKVHBEalk4NUNvbXdsYldOYkNl?= =?utf-8?Q?pzegZkc+D3ytX5IBrF+IfF+79bBGfGsFaissvYR?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0a3c9a0e-ea72-4aa6-f9e9-08d8f2d8cd6c X-MS-Exchange-CrossTenant-AuthSource: MW3PR12MB4379.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Mar 2021 17:33:44.8663 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: gfcHNo2x8Xy/3Rj9y91vep7abQf49E+b3wi70QPMIm5+oiMNvfzvalQH6sPsIyhBX5/N/P1usGDUaoWe/PdQ4g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2476 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-03-29 3:54 a.m., Louis Li wrote: > [Why] > This issue is found when scaling is not equal to one from src to dest. > When issue happens, there are offsets in both axis x and y between > two cursors. Users cannot control APP under such a condition. > What's the use case? I don't think we support two cursors on a screen. Does this pass IGT cursor tests? Nick, I thought we don't allow cursor on anything but the top, unscaled pipe. Harry > [How] > For dual cursors, cursor should be disabled if there is a visible pipe > on top of the current pipe at the current cursor position. > For offsets between two cursors, need translate cursor position from > stream space to plane space with scaling into consideration. > > Tested-by: Louis Li > Signed-off-by: Louis Li > Change-Id: Ic19e4f3b9225736f037f5ade10b68e8afe5f9ab7 > --- > .../amd/display/dc/dcn10/dcn10_hw_sequencer.c | 40 ++++++++++++++----- > 1 file changed, 30 insertions(+), 10 deletions(-) > > diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c > index 83212ea40077..1ce5e58e3a9e 100644 > --- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c > +++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c > @@ -2999,6 +2999,10 @@ static bool dcn10_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx) > const struct rect *r1 = &pipe_ctx->plane_res.scl_data.recout, *r2; > int r1_r = r1->x + r1->width, r1_b = r1->y + r1->height, r2_r, r2_b; > > + struct dc_cursor_position pos_cpy = pipe_ctx->stream->cursor_position; > + int cp_x = pos_cpy.x; > + int cp_y = pos_cpy.y; > + > /** > * Disable the cursor if there's another pipe above this with a > * plane that contains this pipe's viewport to prevent double cursor > @@ -3013,7 +3017,8 @@ static bool dcn10_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx) > r2_r = r2->x + r2->width; > r2_b = r2->y + r2->height; > > - if (r1->x >= r2->x && r1->y >= r2->y && r1_r <= r2_r && r1_b <= r2_b) > + if ((cp_x >= r1->x && cp_y >= r1->y && cp_x <= r1_r && cp_y <= r1_b) > + && (cp_x >= r2->x && cp_y >= r2->y && cp_x <= r2_r && cp_y <= r2_b)) > return true; > } > > @@ -3034,15 +3039,30 @@ static void dcn10_set_cursor_position(struct pipe_ctx *pipe_ctx) > .rotation = pipe_ctx->plane_state->rotation, > .mirror = pipe_ctx->plane_state->horizontal_mirror > }; > - uint32_t x_plane = pipe_ctx->plane_state->dst_rect.x; > - uint32_t y_plane = pipe_ctx->plane_state->dst_rect.y; > - uint32_t x_offset = min(x_plane, pos_cpy.x); > - uint32_t y_offset = min(y_plane, pos_cpy.y); > - > - pos_cpy.x -= x_offset; > - pos_cpy.y -= y_offset; > - pos_cpy.x_hotspot += (x_plane - x_offset); > - pos_cpy.y_hotspot += (y_plane - y_offset); > + > + int x_plane = pipe_ctx->plane_state->dst_rect.x; > + int y_plane = pipe_ctx->plane_state->dst_rect.y; > + int x_pos = pos_cpy.x; > + int y_pos = pos_cpy.y; > + > + // translate cursor from stream space to plane space > + x_pos = (x_pos - x_plane) * pipe_ctx->plane_state->src_rect.width / > + pipe_ctx->plane_state->dst_rect.width; > + y_pos = (y_pos - y_plane) * pipe_ctx->plane_state->src_rect.height / > + pipe_ctx->plane_state->dst_rect.height; > + > + if (x_pos < 0) { > + pos_cpy.x_hotspot -= x_pos; > + x_pos = 0; > + } > + > + if (y_pos < 0) { > + pos_cpy.y_hotspot -= y_pos; > + y_pos = 0; > + } > + > + pos_cpy.x = (uint32_t)x_pos; > + pos_cpy.y = (uint32_t)y_pos; > > if (pipe_ctx->plane_state->address.type > == PLN_ADDR_TYPE_VIDEO_PROGRESSIVE) >