Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1BD954F8A for ; Tue, 27 Feb 2024 07:56:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709020579; cv=none; b=AW7XH5uwh+4ra8NViLRZHQZ1a7UW4GDVnWNOwVxrgdOOI5EJnFbVjxIL4svQ97bqPHHCU7B+7I828a5PKeTM2Uq4/sShM9L0xg7A9DqLFvLkO+GeebwfyZLRb4r3G6TWJkjex7W+UMXZXSB8aSCeshDUQS0CZHoV247lXOIBTnk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709020579; c=relaxed/simple; bh=hxkjC0A9gjtmk/Qkwo36HxXwjaicWtTsqeCiWFnFEXk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=nbmTG2gy4Ap6Kmnmd8gYDsTnRJdsveXE7qWoA27BQJiDTRMnL9kc9YrEEunauTUpKG8rB1QDUxOMA/G+ttdt0J4e2XKARG00RaUEnSHauhQOiq0cbblsZRZLaD0atVR7/Sd4/S9yYBTqWSmdnWZh7y+seN0ZoMPc0nltZkmxX64= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Vim2Qscm; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=4Qgak/l+; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=NmLSdHVR; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=IwXSp6Mu; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Vim2Qscm"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="4Qgak/l+"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="NmLSdHVR"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="IwXSp6Mu" Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [10.150.64.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B5D8E1F444; Tue, 27 Feb 2024 07:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709020575; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=rtT8FLtqsFFAIgaSthkcnPKmQtleXcUfzGQxlsip7Fg=; b=Vim2Qscm0OD0gHsSuszEjwIyn6yd//+M3d1SPi+nl5rXaZClyE2nOZNfN69tp6eHZ/jj85 XHqGkDWbgItNU3s0Kvq7YVPy+cSMOX0l7ZwUB0IJJzG0MiwtETh8RLcsMMtLVStKomLtmD Xf8S3E8eCYi7asxzFWcc/SYYtaJMm6w= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709020575; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=rtT8FLtqsFFAIgaSthkcnPKmQtleXcUfzGQxlsip7Fg=; b=4Qgak/l+PkkYEB2QJYmyT9OTfGVxjpo7mPmbiDGkK54PnVtRNV08sYIHphvtNQWB28SayQ hmrtxNI4iuslH6BA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1709020573; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=rtT8FLtqsFFAIgaSthkcnPKmQtleXcUfzGQxlsip7Fg=; b=NmLSdHVRPvt+2dDWg9csR18+wQuZc17/6H2hwmtBtryVbRn8A+k/9/25uNzwGZbha45zev GFHyWUbnSsmWrnxegzhz3Fwvcwbcc9chtcPnKrdG4DtsrwEB9y3FR2oJsmtVUbwxSxsqhW OuHNndDQ7C+EBgGlok6EcdaUPTVq7CM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1709020573; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:autocrypt:autocrypt; bh=rtT8FLtqsFFAIgaSthkcnPKmQtleXcUfzGQxlsip7Fg=; b=IwXSp6MuPKsDTbyIs70XOM8f91GkzkDf5tJK4+U3/uhnE+yIe+m9G+YVeUkNNXqs+rfAII t2zjdTnbLAE/9MAA== Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id 5F7AC13216; Tue, 27 Feb 2024 07:56:13 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id VaxEFZ2V3WVWHQAAn2gu4w (envelope-from ); Tue, 27 Feb 2024 07:56:13 +0000 Message-ID: <7d98a0cd-e6d5-460d-8b91-35fa340736dd@suse.de> Date: Tue, 27 Feb 2024 08:56:12 +0100 Precedence: bulk X-Mailing-List: linux-fbdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 0/2] Fixes for omapdrm console To: Tony Lindgren Cc: Tomi Valkeinen , dri-devel@lists.freedesktop.org, linux-fbdev@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , David Airlie , Daniel Vetter , Helge Deller , Javier Martinez Canillas , Sam Ravnborg References: <20240225064700.48035-1-tony@atomide.com> <43fc93f1-d602-47ae-98e5-ee6be4ea5192@ideasonboard.com> <42255362-4720-414e-b442-f98355e92968@ideasonboard.com> <20240226112549.GU5299@atomide.com> <20240227070624.GB52537@atomide.com> Content-Language: en-US From: Thomas Zimmermann Autocrypt: addr=tzimmermann@suse.de; keydata= xsBNBFs50uABCADEHPidWt974CaxBVbrIBwqcq/WURinJ3+2WlIrKWspiP83vfZKaXhFYsdg XH47fDVbPPj+d6tQrw5lPQCyqjwrCPYnq3WlIBnGPJ4/jreTL6V+qfKRDlGLWFjZcsrPJGE0 BeB5BbqP5erN1qylK9i3gPoQjXGhpBpQYwRrEyQyjuvk+Ev0K1Jc5tVDeJAuau3TGNgah4Yc hdHm3bkPjz9EErV85RwvImQ1dptvx6s7xzwXTgGAsaYZsL8WCwDaTuqFa1d1jjlaxg6+tZsB 9GluwvIhSezPgnEmimZDkGnZRRSFiGP8yjqTjjWuf0bSj5rUnTGiyLyRZRNGcXmu6hjlABEB AAHNJ1Rob21hcyBaaW1tZXJtYW5uIDx0emltbWVybWFubkBzdXNlLmRlPsLAjgQTAQgAOAIb AwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgBYhBHIX+6yM6c9jRKFo5WgNwR1TC3ojB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Kvmz0rYVRaitYJ 4kyYYMhuULvrJDMjZRvaNe52tkKAvMevcGdt38H4KSVXAylqyQOW5zvPc4/sq9c= In-Reply-To: <20240227070624.GB52537@atomide.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -4.29 X-Spamd-Result: default: False [-4.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com,gmx.de]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; BAYES_HAM(-3.00)[100.00%]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; RCPT_COUNT_SEVEN(0.00)[11]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,bootlin.com:url,atomide.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_CC(0.00)[ideasonboard.com,lists.freedesktop.org,vger.kernel.org,linux.intel.com,kernel.org,gmail.com,ffwll.ch,gmx.de,redhat.com,ravnborg.org]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Flag: NO Hi Am 27.02.24 um 08:06 schrieb Tony Lindgren: > * Tony Lindgren [240226 13:26]: >> * Thomas Zimmermann [240226 09:10]: >>> Am 26.02.24 um 10:01 schrieb Tomi Valkeinen: >>>> On 26/02/2024 10:26, Tomi Valkeinen wrote: >>>>> How is it broken? I don't usually use the console (or fbdev) but >>>>> enabling it now, it seems to work fine for me, on DRA76 EVM with >>>>> HDMI output. >>> Omapdrm implements drm_framebuffer_funcs.dirty withomap_framebuffer_dirty(). >>> AFAIK DRM semantics requires to run the dirty helper after writing to the >>> framebuffer's memory. Userspace does this via the DIRTYFB ioctl. [1] But (at >>> least) for correctness the console needs to do the same. >>> >>> [1] https://elixir.bootlin.com/linux/v6.7.6/source/drivers/gpu/drm/drm_ioctl.c#L679 >> Yes I noticed console not updating and bisected it down to the two >> commits listed. I did the bisect on a droid4 though with command mode >> LCD. I did not test with HDMI, will give that a try too. > I can reproduce the cache issue with Tomi's omapfb-tests [2] below: > > while true; > do dd if=/dev/urandom of=/dev/fb0 > ~/src/omapfb-tests/test > sleep 1 > done > > That produces short random data stripes on the test image. > >>>> After applying your patches, I see a lot of cache-related artifacts on >>>> the screen when updating the fb. >>> I guess we might need a dma-specific mmap helper to make this work >>> correctly. > Comparing the difference between drm_gem_mmap_obj() and > fb_deferred_io_mmap(), the following test patch makes the cache issue > go away for me. Not sure if this can be set based on some flag, or if > we need a separate fb_deferred_io_wc_mmap() or something like that? > > Regards, > > Tony > > [2] https://github.com/tomba/omapfb-tests > > 8< -------------------- > diff --git a/drivers/video/fbdev/core/fb_defio.c b/drivers/video/fbdev/core/fb_defio.c > --- a/drivers/video/fbdev/core/fb_defio.c > +++ b/drivers/video/fbdev/core/fb_defio.c > @@ -224,6 +224,7 @@ static const struct address_space_operations fb_deferred_io_aops = { > int fb_deferred_io_mmap(struct fb_info *info, struct vm_area_struct *vma) > { > vma->vm_page_prot = pgprot_decrypted(vma->vm_page_prot); > + vma->vm_page_prot = pgprot_writecombine(vm_get_page_prot(vma->vm_flags)); Great, that's exactly what I had in mind! My proposal is to add this mmap function directly to omapdrm. I'll later take care of integrating this into the overall framework. I have a few other ideas in mind that are related to this issue. Ok? Best regards Thomas > > vma->vm_ops = &fb_deferred_io_vm_ops; > vm_flags_set(vma, VM_DONTEXPAND | VM_DONTDUMP); -- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstrasse 146, 90461 Nuernberg, Germany GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman HRB 36809 (AG Nuernberg)