Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5306075imu; Wed, 19 Dec 2018 08:54:54 -0800 (PST) X-Google-Smtp-Source: AFSGD/VPiwP1XyOOZ9J9GHtQdv7obJ0qBr+a1qP+D7qcXEx+80O9IIFJPWoXPDdjaXOo3UxjmrV4 X-Received: by 2002:a17:902:e002:: with SMTP id ca2mr21315844plb.103.1545238494795; Wed, 19 Dec 2018 08:54:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545238494; cv=none; d=google.com; s=arc-20160816; b=kFK0qzzfE14kGX6H2yCEf/a+MYyWHQQlWuQJU2EDxT+JvpKrAjKGS30X6cSQtn+KIY 1YBOgSmm3fXwzT9GRxmF+vEyjSwfDXYr+mHZpmYMKva8PQQpC1csSbmTQKsmj0oTiNtJ uSN/KwhsEwdSywatHXAWKNjtk9vb+wjFqkbAiUMD6qYUKVlYIjggA+Uo4/UtrKO9Su04 P6giT3cA4tVOnXdANPStjH9GeXJ9qJ2Ewc568GVrzcvVYYpkRdYNGUa+zySDZP0gek8l N3+yqPRharPffZ1EFzadtRTXGdCtTl2lNpQ61cpURia+L06EO3GFZepu9uIzTZgWdpCQ 1/HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=JZ1PND9ms8rQlXA+J3nz1imBWbAqbmwYZbGsqtzE+sY=; b=OiqGD2hqF6G26od7QCUjdhZ8SZueC89dIHcsBYdDTKwVZfOoQPQmhs1g+UHFqIPpq8 PkQaEOS1vpoIQRx8Jv7FT2qEKxF/a14qNzWMAgbNkoMR7VNGLVicF9THTEe7R7XiDyWu 5Qbbk05/YslBZfYNlR/bynAgvE8iYeOs5+TFD4o8F/o4CbhWP0pGpScyMDCR0OILTzbc 3Hl64uPWSUVUs4neZVbwoajd/kLn8AUz2C/e3jxrwq0mrV35SIsb0sTYVEk7vuYOfgkp Z4Wlh7rTtcIiUveg+8PBtXOTwOYNTHqv0QYSs+QbnEFtGldQh9JEhxK3rEF8ACpmtrDR NPqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kYKToupj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r39si16755214pld.434.2018.12.19.08.54.38; Wed, 19 Dec 2018 08:54:54 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=kYKToupj; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730235AbeLSPaZ (ORCPT + 99 others); Wed, 19 Dec 2018 10:30:25 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43207 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728764AbeLSPaY (ORCPT ); Wed, 19 Dec 2018 10:30:24 -0500 Received: by mail-lf1-f68.google.com with SMTP id u18so15337958lff.10 for ; Wed, 19 Dec 2018 07:30:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=JZ1PND9ms8rQlXA+J3nz1imBWbAqbmwYZbGsqtzE+sY=; b=kYKToupj34EInptFM5bvsz9EMpQCQBPfM/2UczQX8Cr+rj8ScMG7Uz8dVCtrXAbDaO MxWl9NSQ4flcQSCpOlhcU4Nj7r7QcRHt/wViYe6pkxF0Piw2O7ufmsCBO2QniLJtAXUC 3x2PeGg69f0XIrAIU7CX8BnRNqBEbYnX0uMMq8OeOocYRvDIxvNToRSbjdxGArIH8OHK 2w9vZFMOlFuIUfHQBXqnhoInTbVC2xiNVl+9GLjKtximHyXiH2BQmSYiyczndfDZSc/F bLCU9Rme6z8bB6u2a5m2oJoiH/puyDL+77w1YRsn2rxJQy0bsXjuH8yxntT4z7hJhpUD LJKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=JZ1PND9ms8rQlXA+J3nz1imBWbAqbmwYZbGsqtzE+sY=; b=qgb1b/1AX9zjYcMrMsjAu6zGeT55CyQkI28ASbt8YCQkv/vyexXOjUXMUzm7PixtVD uEhH0gPOfu/DFqGliwe59Vg1hrWlKwYFZwDRV/mUsysdweHPdHH4cTGok7eBQ+kIiwOU HfGDNQDOtLCUiSZ5iO8UolZtKmp8OZcYNxBy/xtmRig4+qljZwPeEfN6c6RQgCkHPwwr Gh3O9vSobM+gZIRXiWmIzSsthsikBGcrsu1dPnFRS+McmWVd3v6rhRsGDLxPs4egs6ee GDv2giByIGaaTQXKTcBLPLuWp9mvRRpyDeB/X05HAoKjmcEaWLlEG0ROE3xME7ryAnem m26Q== X-Gm-Message-State: AA+aEWZXUmC4HSTAtB/dDWFjkCwggrc+NcF7AJK0QyVhGhsVyhLnyz2b Jy1WQ9XAga7hDjK/1c3+ITI= X-Received: by 2002:a19:c70a:: with SMTP id x10mr12530281lff.88.1545233422264; Wed, 19 Dec 2018 07:30:22 -0800 (PST) Received: from [10.17.182.20] (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id e94sm3918086lfi.23.2018.12.19.07.30.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Dec 2018 07:30:21 -0800 (PST) Subject: Re: [PATCH 03/14] drm/bochs: atomic: add atomic_flush+atomic_enable callbacks. To: Gerd Hoffmann , dri-devel@lists.freedesktop.org, David Airlie Cc: David Airlie , open list , "open list:DRM DRIVER FOR BOCHS VIRTUAL GPU" References: <20181219115127.31359-1-kraxel@redhat.com> <20181219115127.31359-4-kraxel@redhat.com> From: Oleksandr Andrushchenko Message-ID: Date: Wed, 19 Dec 2018 17:30:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20181219115127.31359-4-kraxel@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Gerd! On 12/19/18 1:51 PM, Gerd Hoffmann wrote: > Conversion to atomic modesetting, step one. > Add atomic crtc helper callbacks. > > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/bochs/bochs_kms.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/drivers/gpu/drm/bochs/bochs_kms.c b/drivers/gpu/drm/bochs/bochs_kms.c > index f7e6d1a9b3..59d469f343 100644 > --- a/drivers/gpu/drm/bochs/bochs_kms.c > +++ b/drivers/gpu/drm/bochs/bochs_kms.c > @@ -115,6 +115,29 @@ static int bochs_crtc_page_flip(struct drm_crtc *crtc, > return 0; > } > > +static void bochs_crtc_atomic_enable(struct drm_crtc *crtc, > + struct drm_crtc_state *old_crtc_state) > +{ > +} > + > +static void bochs_crtc_atomic_flush(struct drm_crtc *crtc, > + struct drm_crtc_state *old_crtc_state) > +{ > + struct drm_device *dev = crtc->dev; > + struct drm_pending_vblank_event *event; > + unsigned long irqflags; You could probably move these under the actual if where these are needed, but it's up to you > + > + if (crtc->state && crtc->state->event) { > + event = crtc->state->event; > + crtc->state->event = NULL; Not quite sure if touching the event above is allowed w/o holding the event lock > + > + spin_lock_irqsave(&dev->event_lock, irqflags); > + drm_crtc_send_vblank_event(crtc, event); > + spin_unlock_irqrestore(&dev->event_lock, irqflags); > + } > +} > + > + > /* These provide the minimum set of functions required to handle a CRTC */ > static const struct drm_crtc_funcs bochs_crtc_funcs = { > .set_config = drm_crtc_helper_set_config, > @@ -128,6 +151,8 @@ static const struct drm_crtc_helper_funcs bochs_helper_funcs = { > .mode_set_base = bochs_crtc_mode_set_base, > .prepare = bochs_crtc_prepare, > .commit = bochs_crtc_commit, > + .atomic_enable = bochs_crtc_atomic_enable, > + .atomic_flush = bochs_crtc_atomic_flush, > }; > > static const uint32_t bochs_formats[] = {