Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2133932yba; Wed, 3 Apr 2019 01:55:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqw017SOGfRbzxsZRM/qABpFKbzzVA/vANS5rXXbGXS8PdfzvQBfGx5QNOdUnhkz+W/nnkdv X-Received: by 2002:a62:5f84:: with SMTP id t126mr44044179pfb.185.1554281705132; Wed, 03 Apr 2019 01:55:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554281705; cv=none; d=google.com; s=arc-20160816; b=YObRahrMGIOPo4NtzKzQzBahmMa8EC3y8M/Rw8cwinM8NM+fd2P2ytcSn9z3Mu68k8 AdQuEFMTabURE8PDPpqeEiE/kXZf9ZdJyl1q25cOaf+MYVnRjv8Jw5jL6tEFj/gA8LHL T4J36iSpq0yF2/9pCii61UyYAeGealgRTK02iK/e3gMNigqnoH978AklEDT3R1qvMo+2 fJ2B7Po4UHEFfSqRNO/req0AUIQDsVg2wlhSenKdCNaZhGbK/TG0ZLGxUsl6LrBOQt6j xM5KNcmRGkdlzLsTZVjKSnN7PeE4tk8ncocKkpBM3wrI3y5IDdIQ6q7DTKthckYijXOy fGcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=KjTERwyHm88cKcIZEQBDW0bSX/jSLsT48CWFVML6+q0=; b=Sr3c7bjH0PNPAcBnRAtZZ6WSgXbIpshn9he98Ts5OVDz07G6782LW+3Zz894G4OGwK cP2uKCLaYQ9pTutxX+pqAdBeDuYGA3shbubnRY2k22e0uUVpHeREcvTfWQEommizEHLr m1xU2UapAAcDZhggIZbDiokMnOm0Jq/4LryJGqGqlYwDhMEsEd5ddakSo0pqXXxSlKnV YOt9KkyVBf5IJSAW5w6avLFEHwBSPI4OXgf5WTbnKvs0IsOl04cvjG1JXTcf/sGhTPXd g8UNqszVoandHM65gxIJP/h5uu469c5939FJwaUZtl19P4UPN73oSHYVnYKUpSZHT6+V q1KA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h125si13458899pgc.290.2019.04.03.01.54.49; Wed, 03 Apr 2019 01:55:05 -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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726372AbfDCIxn (ORCPT + 99 others); Wed, 3 Apr 2019 04:53:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44692 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725822AbfDCIxn (ORCPT ); Wed, 3 Apr 2019 04:53:43 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1536D307D91F; Wed, 3 Apr 2019 08:53:43 +0000 (UTC) Received: from sirius.home.kraxel.org (ovpn-116-22.ams2.redhat.com [10.36.116.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id B70075D6B3; Wed, 3 Apr 2019 08:53:42 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id C19B416E2C; Wed, 3 Apr 2019 10:53:41 +0200 (CEST) Date: Wed, 3 Apr 2019 10:53:41 +0200 From: Gerd Hoffmann To: Daniel Vetter Cc: dri-devel , Dave Airlie , David Airlie , open list , "open list:DRM DRIVER FOR QEMU'S CIRRUS DEVICE" Subject: Re: [PATCH] drm/cirrus: rewrite and modernize driver. Message-ID: <20190403085341.2cxdgxqrjlwecx3n@sirius.home.kraxel.org> References: <20190403072318.31507-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.48]); Wed, 03 Apr 2019 08:53:43 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +struct cirrus_device { > > + struct drm_device *dev; > > Why not embed drm_device? It's the latest rage :-) Sure, can do that. > > +void cirrus_pipe_update(struct drm_simple_display_pipe *pipe, > > + struct drm_plane_state *old_state) > > +{ > > + struct drm_plane_state *state = pipe->plane.state; > > + struct drm_crtc *crtc = &pipe->crtc; > > + struct drm_rect rect; > > + > > + if (drm_atomic_helper_damage_merged(old_state, state, &rect)) > > + cirrus_fb_blit_rect(pipe->plane.state->fb, &rect); > > + > > + if (crtc->state->event) { > > + spin_lock_irq(&crtc->dev->event_lock); > > + drm_crtc_send_vblank_event(crtc, crtc->state->event); > > + spin_unlock_irq(&crtc->dev->event_lock); > > + crtc->state->event = NULL; > > + } > > +} > > +static int cirrus_fb_dirty(struct drm_framebuffer *fb, > > + struct drm_file *file_priv, > > + unsigned int flags, unsigned int color, > > + struct drm_clip_rect *clips, > > + unsigned int num_clips) > > +{ > > + struct cirrus_device *cirrus = fb->dev->dev_private; > > + > > + if (cirrus->pipe.plane.state->fb != fb) > > + return 0; > > + > > + if (num_clips) > > + cirrus_fb_blit_clips(fb, clips, num_clips); > > + else > > + cirrus_fb_blit_fullscreen(fb); > > + return 0; > > +} > > Why not use the dirty helpers and implement dirty rect support in your > main plane update function? Dirty rect support is already there, see above. So I can just remove cirrus_fb_dirty() and hook up drm_atomic_helper_dirtyfb() instead. Easy ;) cheers, Gerd