Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2928149yba; Tue, 16 Apr 2019 00:35:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwbPU5M7RA0h6GAeA+cQrJuwMG8g10yE1ZlgvXSBsotkEJdz/wByqW1l4hxmEvFyZg0ueEc X-Received: by 2002:a62:2587:: with SMTP id l129mr81242818pfl.151.1555400122404; Tue, 16 Apr 2019 00:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555400122; cv=none; d=google.com; s=arc-20160816; b=BKTX9jkrlw+6yfjmyZHqUfTmVQZKIJfuUyusAIWRL7Pnp6F2B6JE7tzKm/vl+FVtpE hHIan8X6m9lmAQfNKgufMxwymkZUVTXi797AGj8XM5OsSJhbMHIwXaN6owmNWHsXLKyW 3z1nIklubmtAna1JphKavh9+dOf4EC0H/OMTfUk4qBXVSGAsQJd6DyCrZI0MbwIr4yV7 3blowPUiGYC265NEi/L/+3HNQMSfbT/7Sd/QmEjY+I+OuEQyjQ72qocmTQBYkPQnezFg kqb96qwntAbezUXpdIrSc1QPXvU8RsZmVT5PeYcP1FNjPHfjz3lbqx6FcDw9xCqL5EJL 7Yyg== 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-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=VxD0wqk0R74Xd3PERoRqoKTHzKJg4s5+FcZ/4pPZ1eU=; b=rFcW1E0MnM+XEX95oUPSxHVim6QD2SKMb2X25uoRQBFd8YdZFnU2VjQDsEo8j1mpGV RDaTaWH1rpak4SP29y4MzUvfk0BW8cccZOQC9SNiHC3gX84XnPBrKOJQt8ZIyMCkMvUz mk3z+XoOrhEexQNGjlC4LiKrJN//pDEAm1gqaPy9PnDslmTND87jnJUYevQyCoky7i37 oeUqs1yaYMS64lv4Jk8QAktR9q2knmZpqyHT0Q1HfWMgViI6O8p1/x/wgTrVSoT4pwoZ 1dy+kX1I6ATssBsBscZwz5Xqct3Imu8PKZnPaYgF6E3pLQzhkvYY9LJ+R5vNVnlq1hBz 7CTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b="Y/xUCFep"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si27103352pgr.202.2019.04.16.00.35.06; Tue, 16 Apr 2019 00:35:22 -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; dkim=fail header.i=@ffwll.ch header.s=google header.b="Y/xUCFep"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728650AbfDPHe0 (ORCPT + 99 others); Tue, 16 Apr 2019 03:34:26 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:36879 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726783AbfDPHeZ (ORCPT ); Tue, 16 Apr 2019 03:34:25 -0400 Received: by mail-ed1-f66.google.com with SMTP id f53so15412938ede.4 for ; Tue, 16 Apr 2019 00:34:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VxD0wqk0R74Xd3PERoRqoKTHzKJg4s5+FcZ/4pPZ1eU=; b=Y/xUCFep/P+HetuAUFL9HEFkYIUhS0xEqTQugGY85NZEFmNOeKaDlkp/93DoSjOYyC ycsITVT21XJHZMxmote41j2wwxVABkcOqLyHQdOpJ2x/q4YjmeH1w6xIPq/VuR/HUxI8 KyenNuZGrvAfn/NbDww2U5N1gptFgpB8HrXnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=VxD0wqk0R74Xd3PERoRqoKTHzKJg4s5+FcZ/4pPZ1eU=; b=gKDxLz1zxrgONSLiwP4MoQfJBZsYe/yWEoiBm3UsLdkqowqOQxdYzfK/41pVczQacQ fNeIBEhhT5PceayH4UtPbjDGXfFwZDT5gA+hH5l9Y8ksHVtp1LjvvneDYAdrcIyDcllq LH/+poV5K1l9XfH2JXYFfo8tfISeOsurBjG43OeknhYeAPLra4ZguZtlXOmcsAYdwNpl n9Jg43sjzuVir/iSaM5otoPKdJ+AjXw5dcw70TZ+Ke7RTqfauGxA9o6p85wJKxHP4bWQ IUcM08HO5rKQ9itAWtK1iUa7QGBIvil/mvOdeeZv5m4DT0P2XKEgrgahW5KcgyjEL/Gs XWjg== X-Gm-Message-State: APjAAAVSSQDHCYR9bS870lVgyWQKYYjECcyISFJcsqdgVpshn/mpk1JW WaI+y7lencDsiOgeH3QCKECeeQ== X-Received: by 2002:a50:9dc8:: with SMTP id l8mr8049845edk.180.1555400063146; Tue, 16 Apr 2019 00:34:23 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:569e:0:3106:d637:d723:e855]) by smtp.gmail.com with ESMTPSA id v9sm3336323ede.32.2019.04.16.00.34.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 16 Apr 2019 00:34:21 -0700 (PDT) Date: Tue, 16 Apr 2019 09:34:20 +0200 From: Daniel Vetter To: Liviu Dudau Cc: "james qian wang (Arm Technology China)" , "airlied@linux.ie" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "maxime.ripard@bootlin.com" , nd , "sean@poorly.run" , Ben Davis Subject: Re: [v2,1/2] drm: Add writeback_w,h properties Message-ID: <20190416073419.GN2665@phenom.ffwll.local> Mail-Followup-To: Liviu Dudau , "james qian wang (Arm Technology China)" , "airlied@linux.ie" , "linux-kernel@vger.kernel.org" , "dri-devel@lists.freedesktop.org" , "maxime.ripard@bootlin.com" , nd , "sean@poorly.run" , Ben Davis References: <1555078094-6587-2-git-send-email-ben.davis@arm.com> <20190415075922.GA24596@james-ThinkStation-P300> <20190415092045.GO15144@e110455-lin.cambridge.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190415092045.GO15144@e110455-lin.cambridge.arm.com> X-Operating-System: Linux phenom 4.19.0-1-amd64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 15, 2019 at 10:20:45AM +0100, Liviu Dudau wrote: > On Mon, Apr 15, 2019 at 08:59:30AM +0100, james qian wang (Arm Technology China) wrote: > > On Fri, Apr 12, 2019 at 02:08:28PM +0000, Ben Davis wrote: > > > Add new properties to specify width and height for writeback. > > > > > > Signed-off-by: Ben Davis > > > --- > > > drivers/gpu/drm/drm_atomic_uapi.c | 8 ++++++++ > > > drivers/gpu/drm/drm_writeback.c | 28 ++++++++++++++++++++++++++++ > > > include/drm/drm_connector.h | 4 ++++ > > > include/drm/drm_mode_config.h | 10 ++++++++++ > > > 4 files changed, 50 insertions(+) > > > > > > -- > > > 2.7.4 > > > > > > diff --git a/drivers/gpu/drm/drm_atomic_uapi.c b/drivers/gpu/drm/drm_atomic_uapi.c > > > index d520a04..1f68dce 100644 > > > --- a/drivers/gpu/drm/drm_atomic_uapi.c > > > +++ b/drivers/gpu/drm/drm_atomic_uapi.c > > > @@ -765,6 +765,10 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, > > > return -EINVAL; > > > } > > > state->content_protection = val; > > > + } else if (property == config->prop_writeback_w) { > > > + state->writeback_w = val; > > > + } else if (property == config->prop_writeback_h) { > > > + state->writeback_h = val; > > > } else if (property == config->writeback_fb_id_property) { > > > struct drm_framebuffer *fb = drm_framebuffer_lookup(dev, NULL, val); > > > int ret = drm_atomic_set_writeback_fb_for_connector(state, fb); > > > @@ -837,6 +841,10 @@ drm_atomic_connector_get_property(struct drm_connector *connector, > > > *val = state->scaling_mode; > > > } else if (property == connector->content_protection_property) { > > > *val = state->content_protection; > > > + } else if (property == config->prop_writeback_w) { > > > + *val = state->writeback_w; > > > + } else if (property == config->prop_writeback_h) { > > > + *val = state->writeback_h; > > > } else if (property == config->writeback_fb_id_property) { > > > /* Writeback framebuffer is one-shot, write and forget */ > > > *val = 0; > > > diff --git a/drivers/gpu/drm/drm_writeback.c b/drivers/gpu/drm/drm_writeback.c > > > index c20e6fe..3d0453e 100644 > > > --- a/drivers/gpu/drm/drm_writeback.c > > > +++ b/drivers/gpu/drm/drm_writeback.c > > > @@ -74,6 +74,12 @@ > > > * applications making use of writeback connectors *always* retrieve an > > > * out-fence for the commit and use it appropriately. > > > * From userspace, this property will always read as zero. > > > + * > > > + * "WRITEBACK_W": > > > + * The width of the writeback buffer to write back. 0 acts as default. > > > + * > > > + * "WRITEBACK_H": > > > + * The height of the writeback buffer to write back. 0 acts as default. > > > */ > > > > > > #define fence_to_wb_connector(x) container_of(x->lock, \ > > > @@ -141,6 +147,22 @@ static int create_writeback_properties(struct drm_device *dev) > > > dev->mode_config.writeback_out_fence_ptr_property = prop; > > > } > > > > > > + if (!dev->mode_config.prop_writeback_w) { > > > + prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC, > > > + "WRITEBACK_W", 1, UINT_MAX); > > > + if (!prop) > > > + return -ENOMEM; > > > + dev->mode_config.prop_writeback_w = prop; > > > + } > > > + > > > + if (!dev->mode_config.prop_writeback_h) { > > > + prop = drm_property_create_range(dev, DRM_MODE_PROP_ATOMIC, > > > + "WRITEBACK_H", 1, UINT_MAX); > > > + if (!prop) > > > + return -ENOMEM; > > > + dev->mode_config.prop_writeback_h = prop; > > > + } > > > + > > > return 0; > > > } > > > > > > @@ -225,6 +247,12 @@ int drm_writeback_connector_init(struct drm_device *dev, > > > drm_object_attach_property(&connector->base, > > > config->writeback_pixel_formats_property, > > > blob->base.id); > > > + > > > + drm_object_attach_property(&connector->base, > > > + config->prop_writeback_w, 0); > > > + drm_object_attach_property(&connector->base, > > > + config->prop_writeback_h, 0); > > > > Hi Ben: > > Do we real need these two individual properties for specifing the writeback > > w/h, can we use fb->w/h ? > > And since these two properties are added as common and standard properties, > > it influnce all existing write-back implementation which all assumed > > writeback size as fb->w/h. > > The idea of having these additional properties was to maintain backwards > compatibility (of some sort). If you don't set writeback_w/h then the > assumption is that they are the same as fb->w/h, but I can see how it's > going to be confusing to have fb->w/h different from crtc->w/h and > different from writeback_w/h. Since we already have crtc_w/h independent of writeback_fb_w/h, do we need another set of w/h? Are all the interactions between these tree well-defined? Atm I'm assuming that writeback is using crtc_w/h into the fb, at offset 0, not scaled any further. But the planes themselves can be scaled into the crtc_w/h window ofc. Iirc the hw supporting writeback thus far needs a dedicated crtc for writeback, so adding yet another scaling window is not needed? -Daniel > > To compatible with existing writeback support, I suggest to keep to > > use fb->w/h or add these properties as malidp private. > > We don't need to make them malidp private, there is nothing malidp > specific in them. I'll talk with Ben, we should probably drop this patch > entirely and just enable malidp scaling when fb->w/h differ from > crtc->w/h. > > Best regards, > Liviu > > > > > > Thanks > > James > > > > > > > wb_connector->pixel_formats_blob_ptr = blob; > > > > > > return 0; > > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h > > > index 8fe22ab..51c4cb2 100644 > > > --- a/include/drm/drm_connector.h > > > +++ b/include/drm/drm_connector.h > > > @@ -515,6 +515,10 @@ struct drm_connector_state { > > > */ > > > struct drm_writeback_job *writeback_job; > > > > > > + /** @writeback_w: width of plane to write to wb buffer */ > > > + /** @writeback_h: height of plane to write to wb buffer */ > > > + uint32_t writeback_w, writeback_h; > > > + > > > /** > > > * @max_requested_bpc: Connector property to limit the maximum bit > > > * depth of the pixels. > > > diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h > > > index 7f60e8e..a0c2133 100644 > > > --- a/include/drm/drm_mode_config.h > > > +++ b/include/drm/drm_mode_config.h > > > @@ -622,6 +622,16 @@ struct drm_mode_config { > > > */ > > > struct drm_property *prop_crtc_h; > > > /** > > > + * @prop_writeback_w: Writeback connector property for the plane > > > + * destination position in the writeback buffer. > > > + */ > > > + struct drm_property *prop_writeback_w; > > > + /** > > > + * @prop_writeback_h: Writeback connector property for the plane > > > + * destination position in the writeback buffer. > > > + */ > > > + struct drm_property *prop_writeback_h; > > > + /** > > > * @prop_fb_id: Default atomic plane property to specify the > > > * &drm_framebuffer. > > > */ > > > > Pls del this window style line ending > > > > -- > ==================== > | I would like to | > | fix the world, | > | but they're not | > | giving me the | > \ source code! / > --------------- > ¯\_(ツ)_/¯ > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch