From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751806AbcDTVXB (ORCPT ); Wed, 20 Apr 2016 17:23:01 -0400 Received: from mail-oi0-f43.google.com ([209.85.218.43]:35289 "EHLO mail-oi0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751092AbcDTVW6 convert rfc822-to-8bit (ORCPT ); Wed, 20 Apr 2016 17:22:58 -0400 MIME-Version: 1.0 X-Originating-IP: [2a02:168:56b5:0:ac27:b86c:7764:9429] In-Reply-To: <5717D679.5070809@tronnes.org> References: <1461165929-11344-1-git-send-email-noralf@tronnes.org> <1461165929-11344-9-git-send-email-noralf@tronnes.org> <20160420175903.GS2510@phenom.ffwll.local> <5717D679.5070809@tronnes.org> Date: Wed, 20 Apr 2016 23:22:52 +0200 X-Google-Sender-Auth: Kr0kkCf_0VCnivZb4Hee4QjcDrw Message-ID: Subject: Re: [PATCH 8/8] drm/udl: Use drm_fb_helper deferred_io support From: Daniel Vetter To: =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= Cc: dri-devel , Linux Fbdev development list , Laurent Pinchart , Tomi Valkeinen , Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 20, 2016 at 9:20 PM, Noralf Trønnes wrote: >>> @@ -330,20 +203,20 @@ static int udl_fb_open(struct fb_info *info, int >>> user) >>> ufbdev->fb_count++; >>> - if (fb_defio && (info->fbdefio == NULL)) { >>> - /* enable defio at last moment if not disabled by client >>> */ >>> + if (!info->fbdefio) { >>> + /* enable defio at last moment */ >>> struct fb_deferred_io *fbdefio; >>> fbdefio = kmalloc(sizeof(struct fb_deferred_io), >>> GFP_KERNEL); >>> - >>> if (fbdefio) { >>> fbdefio->delay = DL_DEFIO_WRITE_DELAY; >>> - fbdefio->deferred_io = udlfb_dpy_deferred_io; >>> + fbdefio->deferred_io = drm_fb_helper_deferred_io; >> >> Why all these changes here? I figured just exchanging the deferred_io >> pointer should be all that's really needed in the setup code? > > > Because we always need to initialize deferred_io since we use it's worker > to handle fb_{fillrect,copyarea,imageblit} damage in drm_fb_helper. > > The previous code didn't use deferred_io to handle these, it just handled > the damage directly unless it was running in atomic context, in which case > it just recorded the damage and returned, leaving it to the next call to > push the changes. That kind of explanation needs to be added to the commit message. I completely missed that udl doesn't have an async work item for defio from atomic. > And in the following code I fixed a null pointer problem as well, maybe I > shouldn't have packed it in here. If fbdefio allocation fails == NULL, > fb_deferred_io_init() will trigger a BUG(). Yeah, better to split that out into a separate bugfix I think. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Date: Wed, 20 Apr 2016 21:22:52 +0000 Subject: Re: [PATCH 8/8] drm/udl: Use drm_fb_helper deferred_io support Message-Id: List-Id: References: <1461165929-11344-1-git-send-email-noralf@tronnes.org> <1461165929-11344-9-git-send-email-noralf@tronnes.org> <20160420175903.GS2510@phenom.ffwll.local> <5717D679.5070809@tronnes.org> In-Reply-To: <5717D679.5070809@tronnes.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= Cc: Linux Fbdev development list , Tomi Valkeinen , Laurent Pinchart , dri-devel , Linux Kernel Mailing List On Wed, Apr 20, 2016 at 9:20 PM, Noralf Tr=C3=B8nnes w= rote: >>> @@ -330,20 +203,20 @@ static int udl_fb_open(struct fb_info *info, int >>> user) >>> ufbdev->fb_count++; >>> - if (fb_defio && (info->fbdefio =3D NULL)) { >>> - /* enable defio at last moment if not disabled by client >>> */ >>> + if (!info->fbdefio) { >>> + /* enable defio at last moment */ >>> struct fb_deferred_io *fbdefio; >>> fbdefio =3D kmalloc(sizeof(struct fb_deferred_io), >>> GFP_KERNEL); >>> - >>> if (fbdefio) { >>> fbdefio->delay =3D DL_DEFIO_WRITE_DELAY; >>> - fbdefio->deferred_io =3D udlfb_dpy_deferred_io; >>> + fbdefio->deferred_io =3D drm_fb_helper_deferred= _io; >> >> Why all these changes here? I figured just exchanging the deferred_io >> pointer should be all that's really needed in the setup code? > > > Because we always need to initialize deferred_io since we use it's worker > to handle fb_{fillrect,copyarea,imageblit} damage in drm_fb_helper. > > The previous code didn't use deferred_io to handle these, it just handled > the damage directly unless it was running in atomic context, in which case > it just recorded the damage and returned, leaving it to the next call to > push the changes. That kind of explanation needs to be added to the commit message. I completely missed that udl doesn't have an async work item for defio from atomic. > And in the following code I fixed a null pointer problem as well, maybe I > shouldn't have packed it in here. If fbdefio allocation fails =3D NULL, > fb_deferred_io_init() will trigger a BUG(). Yeah, better to split that out into a separate bugfix I think. -Daniel --=20 Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 8/8] drm/udl: Use drm_fb_helper deferred_io support Date: Wed, 20 Apr 2016 23:22:52 +0200 Message-ID: References: <1461165929-11344-1-git-send-email-noralf@tronnes.org> <1461165929-11344-9-git-send-email-noralf@tronnes.org> <20160420175903.GS2510@phenom.ffwll.local> <5717D679.5070809@tronnes.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from mail-oi0-x22f.google.com (mail-oi0-x22f.google.com [IPv6:2607:f8b0:4003:c06::22f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 264916EB48 for ; Wed, 20 Apr 2016 21:22:53 +0000 (UTC) Received: by mail-oi0-x22f.google.com with SMTP id r78so56156999oie.0 for ; Wed, 20 Apr 2016 14:22:53 -0700 (PDT) In-Reply-To: <5717D679.5070809@tronnes.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: =?UTF-8?Q?Noralf_Tr=C3=B8nnes?= Cc: Linux Fbdev development list , Tomi Valkeinen , Laurent Pinchart , dri-devel , Linux Kernel Mailing List List-Id: dri-devel@lists.freedesktop.org T24gV2VkLCBBcHIgMjAsIDIwMTYgYXQgOToyMCBQTSwgTm9yYWxmIFRyw7hubmVzIDxub3JhbGZA dHJvbm5lcy5vcmc+IHdyb3RlOgo+Pj4gQEAgLTMzMCwyMCArMjAzLDIwIEBAIHN0YXRpYyBpbnQg dWRsX2ZiX29wZW4oc3RydWN0IGZiX2luZm8gKmluZm8sIGludAo+Pj4gdXNlcikKPj4+ICAgICAg ICAgdWZiZGV2LT5mYl9jb3VudCsrOwo+Pj4gICAtICAgICBpZiAoZmJfZGVmaW8gJiYgKGluZm8t PmZiZGVmaW8gPT0gTlVMTCkpIHsKPj4+IC0gICAgICAgICAgICAgICAvKiBlbmFibGUgZGVmaW8g YXQgbGFzdCBtb21lbnQgaWYgbm90IGRpc2FibGVkIGJ5IGNsaWVudAo+Pj4gKi8KPj4+ICsgICAg ICAgaWYgKCFpbmZvLT5mYmRlZmlvKSB7Cj4+PiArICAgICAgICAgICAgICAgLyogZW5hYmxlIGRl ZmlvIGF0IGxhc3QgbW9tZW50ICovCj4+PiAgICAgICAgICAgICAgICAgc3RydWN0IGZiX2RlZmVy cmVkX2lvICpmYmRlZmlvOwo+Pj4gICAgICAgICAgICAgICAgIGZiZGVmaW8gPSBrbWFsbG9jKHNp emVvZihzdHJ1Y3QgZmJfZGVmZXJyZWRfaW8pLAo+Pj4gR0ZQX0tFUk5FTCk7Cj4+PiAtCj4+PiAg ICAgICAgICAgICAgICAgaWYgKGZiZGVmaW8pIHsKPj4+ICAgICAgICAgICAgICAgICAgICAgICAg IGZiZGVmaW8tPmRlbGF5ID0gRExfREVGSU9fV1JJVEVfREVMQVk7Cj4+PiAtICAgICAgICAgICAg ICAgICAgICAgICBmYmRlZ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