From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5C1B3C433DF for ; Mon, 6 Jul 2020 19:36:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1ACFA20675 for ; Mon, 6 Jul 2020 19:36:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1ACFA20675 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ilande.co.uk Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B22689F4A; Mon, 6 Jul 2020 19:36:52 +0000 (UTC) Received: from mail.default.ilande.uk0.bigv.io (mail.ilande.co.uk [IPv6:2001:41c9:1:41f::167]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8CB9289DA5 for ; Mon, 6 Jul 2020 19:36:51 +0000 (UTC) Received: from host86-182-221-233.range86-182.btcentralplus.com ([86.182.221.233] helo=[192.168.1.65]) by mail.default.ilande.uk0.bigv.io with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jsWvB-0001fc-PH; Mon, 06 Jul 2020 20:36:58 +0100 To: Sam Ravnborg References: <671ea432-7e2b-ab37-225e-fd32aef9a3e3@ilande.co.uk> <20200704072305.GA689588@ravnborg.org> <02fbd875-f6fd-da20-6835-778bdd6426c3@ilande.co.uk> <485ded46-c1a3-1eab-eb95-1a771543fbaf@ilande.co.uk> <20200704134115.GA755192@ravnborg.org> <1d19833f-2977-a12f-f3a9-ef0d509ef366@ilande.co.uk> <20200704145212.GA791554@ravnborg.org> From: Mark Cave-Ayland Autocrypt: addr=mark.cave-ayland@ilande.co.uk; keydata= mQENBFQJuzwBCADAYvxrwUh1p/PvUlNFwKosVtVHHplgWi5p29t58QlOUkceZG0DBYSNqk93 3JzBTbtd4JfFcSupo6MNNOrCzdCbCjZ64ik8ycaUOSzK2tKbeQLEXzXoaDL1Y7vuVO7nL9bG E5Ru3wkhCFc7SkoypIoAUqz8EtiB6T89/D9TDEyjdXUacc53R5gu8wEWiMg5MQQuGwzbQy9n PFI+mXC7AaEUqBVc2lBQVpAYXkN0EyqNNT12UfDLdxaxaFpUAE2pCa2LTyo5vn5hEW+i3VdN PkmjyPvL6DdY03fvC01PyY8zaw+UI94QqjlrDisHpUH40IUPpC/NB0LwzL2aQOMkzT2NABEB AAG0ME1hcmsgQ2F2ZS1BeWxhbmQgPG1hcmsuY2F2ZS1heWxhbmRAaWxhbmRlLmNvLnVrPokB OAQTAQIAIgUCVAm7PAIbAwYLCQgHAwIGFQgCCQoLBBYCAwECHgECF4AACgkQW8LFb64PMh9f NAgAuc3ObOEY8NbZko72AGrg2tWKdybcMVITxmcor4hb9155o/OWcA4IDbeATR6cfiDL/oxU mcmtXVgPqOwtW3NYAKr5g/FrZZ3uluQ2mtNYAyTFeALy8YF7N3yhs7LOcpbFP7tEbkSzoXNG z8iYMiYtKwttt40WaheWuRs0ZOLbs6yoczZBDhna3Nj0LA3GpeJKlaV03O4umjKJgACP1c/q T2Pkg+FCBHHFP454+waqojHp4OCBo6HyK+8I4wJRa9Z0EFqXIu8lTDYoggeX0Xd6bWeCFHK3 DhD0/Xi/kegSW33unsp8oVcM4kcFxTkpBgj39dB4KwAUznhTJR0zUHf63LkBDQRUCbs8AQgA y7kyevA4bpetM/EjtuqQX4U05MBhEz/2SFkX6IaGtTG2NNw5wbcAfhOIuNNBYbw6ExuaJ3um 2uLseHnudmvN4VSJ5Hfbd8rhqoMmmO71szgT/ZD9MEe2KHzBdmhmhxJdp+zQNivy215j6H27 14mbC2dia7ktwP1rxPIX1OOfQwPuqlkmYPuVwZP19S4EYnCELOrnJ0m56tZLn5Zj+1jZX9Co YbNLMa28qsktYJ4oU4jtn6V79H+/zpERZAHmH40IRXdR3hA+Ye7iC/ZpWzT2VSDlPbGY9Yja Sp7w2347L5G+LLbAfaVoejHlfy/msPeehUcuKjAdBLoEhSPYzzdvEQARAQABiQEfBBgBAgAJ BQJUCbs8AhsMAAoJEFvCxW+uDzIfabYIAJXmBepHJpvCPiMNEQJNJ2ZSzSjhic84LTMWMbJ+ opQgr5cb8SPQyyb508fc8b4uD8ejlF/cdbbBNktp3BXsHlO5BrmcABgxSP8HYYNsX0n9kERv NMToU0oiBuAaX7O/0K9+BW+3+PGMwiu5ml0cwDqljxfVN0dUBZnQ8kZpLsY+WDrIHmQWjtH+ Ir6VauZs5Gp25XLrL6bh/SL8aK0BX6y79m5nhfKI1/6qtzHAjtMAjqy8ChPvOqVVVqmGUzFg KPsrrIoklWcYHXPyMLj9afispPVR8e0tMKvxzFBWzrWX1mzljbBlnV2n8BIwVXWNbgwpHSsj imgcU9TTGC5qd9g= Message-ID: <98897d2e-38bd-6fcf-ab81-3f5f56906fb8@ilande.co.uk> Date: Mon, 6 Jul 2020 20:36:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200704145212.GA791554@ravnborg.org> Content-Language: en-US X-SA-Exim-Connect-IP: 86.182.221.233 X-SA-Exim-Mail-From: mark.cave-ayland@ilande.co.uk Subject: Re: Panic booting qemu-system-sparc64 with bochs_drm X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.default.ilande.uk0.bigv.io) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann , dri-devel@lists.freedesktop.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 04/07/2020 15:52, Sam Ravnborg wrote: > Hi Mark. > > On Sat, Jul 04, 2020 at 03:16:47PM +0100, Mark Cave-Ayland wrote: >> On 04/07/2020 14:41, Sam Ravnborg wrote: >> >>> I think what is happening is that the bochs driver request a shadow copy >>> for the frambuffer. And with the change to fbops we now use the cfb_ >>> functions to write to the shadow framebuffer - which is not in any IO >>> space. So this does not work. >>> >>> So maybe all we need is the fix in drm_fb_helper_dirty_blit_real(). >>> If you try to undo the change so fbops is set to &drm_fbdev_fb_ops, >>> but keep the fix in drm_fb_helper_dirty_blit_real() how does it then >>> behave? >> >> Bingo! I just tried that and the framebuffer is now working under qemu-system-sparc64 >> again - thank you so much for the help! From what you said I guess >> drm_fb_helper_dirty_blit_real() is responsible syncing the shadow copy? >> >> Below is the current working diff based upon your previous one: it certainly feels >> like the difference in memcpy() behaviour should be hidden away in fb_memcpy_tofb() >> or similar. > >>>From your feedback so far I thnk the minimal fix would be like this: > >> --- a/drivers/gpu/drm/drm_fb_helper.c >> +++ b/drivers/gpu/drm/drm_fb_helper.c >> .. static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper, >> size_t len = (clip->x2 - clip->x1) * cpp; >> unsigned int y; >> >> for (y = clip->y1; y < clip->y2; y++) { >> - memcpy(dst, src, len); >> + fb_memcpy_tofb(dst, src, len); >> src += fb->pitches[0]; >> dst += fb->pitches[0]; >> } > > (Hand edited, patch s not a valid syntax) > > But I need feedback from someone that know all this a bit better > to judge if this is an OK change. > For once - this will only work with shadow buffers. Hi Sam, Yes, that's correct - I can confirm that the simplified diff below works: diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 5609e164805f..83af05fac604 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -399,7 +399,7 @@ static void drm_fb_helper_dirty_blit_real(struct drm_fb_helper *fb_helper, unsigned int y; for (y = clip->y1; y < clip->y2; y++) { - memcpy(dst, src, len); + fb_memcpy_tofb(dst, src, len); src += fb->pitches[0]; dst += fb->pitches[0]; } I guess that the next step is to wait for advice from Gerd as to whether this is sufficient, or if other changes are required to allow non-shadow buffers to work on architectures similar to SPARC64 too. ATB, Mark. _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel