From patchwork Tue May 23 16:39:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 9743037 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62B2A60380 for ; Tue, 23 May 2017 16:39:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5487D287EA for ; Tue, 23 May 2017 16:39:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46BE6287E7; Tue, 23 May 2017 16:39:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A9BF9287E7 for ; Tue, 23 May 2017 16:39:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E73E46E284; Tue, 23 May 2017 16:39:48 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-x22e.google.com (mail-yw0-x22e.google.com [IPv6:2607:f8b0:4002:c05::22e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 52D536E2BC for ; Tue, 23 May 2017 16:39:48 +0000 (UTC) Received: by mail-yw0-x22e.google.com with SMTP id l14so77327144ywk.1 for ; Tue, 23 May 2017 09:39:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fooishbar-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=yUFm5v3AqND7C0bFaw+zAN8TyroRdwMOgNtb/NqSoo8=; b=RQptSj2RbOMP6ZEpKdJGPZR71T4JPoM+tYIbv84GO+VgfbwcFaW9kRTUQczGhbCYdb yxRd1TtvrvHUxOMNm1VsW/fMz/dV+lEW9ZvlaIrF++0dWuOAGtrol4gWfhMJSI6HIDIz XK0rrb4aWQ7vKfCwby68VTMiZX2FZRm4hM+vnrYjswR9qfyzspGECBp/akF1Ql3ut1C5 z3yphlc0aNOIH8W4AwIFQ0Cqs2mXSIDh9V87SxPwr3gwG2aeGztJbHyBGJoW8Yh89LEz sWFq2gILO+ivfKQsitqGdVIuEfitszGiae2NW4ubardYNm2QsYeuRrq3ZBkipUf/j4nb XjbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=yUFm5v3AqND7C0bFaw+zAN8TyroRdwMOgNtb/NqSoo8=; b=WN16hTfYh2oliag6aTRoXqfdtZUQFwI1v3NXg/NT/SFjRZNPIEao58rDJ0ukXp7iCf 5/XaqBQdnKVOIK5AvDKewFOEzCL8O5eiAmNopF+RYO0JYHVlKAk+ooXgkL3t8rgiFDBz vw8FnBrYl5yC9hd9O2AYOOPeUDtiWc4/Sf3RrLMv+9pWynKWjseTfj6hZtlO/wVjBGUf jUTNBfyRe7AtMMe+R/fGRfIV3ZV0ZoTRsMHOqAyvkO1VEiYeLzQu0jtqRpor3GmWilko rNWKS5Z0+uzIFhb9muIdivyXLgmQrkxVrBHQr+bOzSXe5Yq37Fi1Uq6klEQuxKcakEAk rdCA== X-Gm-Message-State: AODbwcB/RWV5AG34wRR1/8JtI9Sc6OF0tppjo2bj1KBynM4G+txKAMbl pk3BZeHVEly1cJaXqsYdEMJJ25gR3qEj X-Received: by 10.129.167.9 with SMTP id e9mr13337507ywh.55.1495557587451; Tue, 23 May 2017 09:39:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.37.201.1 with HTTP; Tue, 23 May 2017 09:39:46 -0700 (PDT) In-Reply-To: <20170516213126.8269-2-ben@bwidawsk.net> References: <20170516213126.8269-1-ben@bwidawsk.net> <20170516213126.8269-2-ben@bwidawsk.net> From: Daniel Stone Date: Tue, 23 May 2017 17:39:46 +0100 Message-ID: Subject: Re: [Intel-gfx] [PATCH v2 2/3] drm: Create a format/modifier blob To: Ben Widawsky Cc: Intel GFX , "Kristian H . Kristensen" , Daniel Stone , DRI Development X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi Ben, On 16 May 2017 at 22:31, Ben Widawsky wrote: > Updated blob layout (Rob, Daniel, Kristian, xerpi) If you take the attached fixup, this is: Reviewed-by: Daniel Stone The rest of the series looks fine to me, so you can take my Acked-by, but I'm currently off work sick and am away next week, so please don't block on me for merging. Cheers, Daniel commit 250f3b2c2a824516b18fe21623ddc86ccf31eddb Author: Daniel Stone Date: Tue May 23 17:36:55 2017 +0100 fixup! drm: Create a format/modifier blob diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index f5b032b5f761..083231750583 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c @@ -77,18 +77,12 @@ modifiers_ptr(struct drm_format_modifier_blob *blob) static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane) { const struct drm_mode_config *config = &dev->mode_config; - const uint64_t *temp_modifiers = plane->modifiers; - unsigned int format_modifier_count = 0; struct drm_property_blob *blob = NULL; struct drm_format_modifier *mod; size_t blob_size = 0, formats_size, modifiers_size; struct drm_format_modifier_blob *blob_data; int i, j, ret = 0; - if (plane->modifiers) - while (*temp_modifiers++ != DRM_FORMAT_MOD_INVALID) - format_modifier_count++; - formats_size = sizeof(*plane->format_types) * plane->format_count; if (WARN_ON(!formats_size)) { /* 0 formats are never expected */ @@ -96,7 +90,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane } modifiers_size = - sizeof(struct drm_format_modifier) * format_modifier_count; + sizeof(struct drm_format_modifier) * plane->modifier_count; blob_size = sizeof(struct drm_format_modifier_blob); blob_size += ALIGN(formats_size, 8); @@ -110,7 +104,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane blob_data->version = FORMAT_BLOB_CURRENT; blob_data->count_formats = plane->format_count; blob_data->formats_offset = sizeof(struct drm_format_modifier_blob); - blob_data->count_modifiers = format_modifier_count; + blob_data->count_modifiers = plane->modifier_count; /* Modifiers offset is a pointer to a struct with a 64 bit field so it * should be naturally aligned to 8B. @@ -125,7 +119,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane goto done; mod = modifiers_ptr(blob_data); - for (i = 0; i < format_modifier_count; i++) { + for (i = 0; i < plane->modifier_count; i++) { for (j = 0; j < plane->format_count; j++) { if (plane->funcs->format_mod_supported(plane, plane->format_types[j],