All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Liviu Dudau <liviu@dudau.co.uk>,
	Intel GFX <intel-gfx@lists.freedesktop.org>,
	"Kristian H . Kristensen" <hoegsberg@gmail.com>,
	Daniel Stone <daniels@collabora.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/4] drm: Create a format/modifier blob
Date: Thu, 20 Jul 2017 21:20:32 -0700	[thread overview]
Message-ID: <20170721042032.GA15342@mail.bwidawsk.net> (raw)
In-Reply-To: <20170714191015.GS12629@intel.com>

On 17-07-14 22:10:15, Ville Syrjälä wrote:
>On Fri, Jul 14, 2017 at 11:41:49AM -0700, Ben Widawsky wrote:
>> On 17-06-29 22:49:44, Ville Syrjälä wrote:
>>
>> [snip]
>>
>> >
>> >... but here it's ALIGN(formats_offset+formats_size). I think we should
>> >be aligning the same thing in both cases, or we add a BUILD_BUG_ON to
>> >make sure the header size always stays a multiple of 8 bytes.
>> >
>> >That's mainly because the design of the structure seems geared towards
>> >expanding the header in the future (as in why else would you have the
>> >offsets?).
>> >
>>
>> I guess I don't quite understand what you're asking for. The first thing is
>> determining a size, the second is finding an offset into the blob.
>
>If I remember my thinking correctly, then what I was trying to say was
>
>ALIGN(multiple_of_4, 8) + ALIGN(multiple_of_4, 8) != ALIGN(multiple_of_4 + multiple_of_4, 8)
>
>but the code was assuming that it's true, or that at least one of those
>things is a multiple of 8 already.
>

Going with this and calling it sufficient.

diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c
index 0da6707a8cf7..5c14beee52ff 100644
--- a/drivers/gpu/drm/drm_plane.c
+++ b/drivers/gpu/drm/drm_plane.c
@@ -96,6 +96,7 @@ static int create_in_format_blob(struct drm_device *dev, struct drm_plane *plane
        /* Modifiers offset is a pointer to a struct with a 64 bit field so it
         * should be naturally aligned to 8B.
         */
+       BUILD_BUG_ON(sizeof(struct drm_format_modifier_blob) % 8);
        blob_size += ALIGN(formats_size, 8);
        blob_size += modifiers_size;



>> I don't mind changing this, but tell me what you want.
>>
>> BUILD_BUG_ON sounds good to me regardless.
>>
>> [snip]
>>
>> --
>> Ben Widawsky, Intel Open Source Technology Center
>
>-- 
>Ville Syrjälä
>Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-07-21  4:20 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-23 16:45 [PATCH v4 0/4] Blobifiers (FKA GET_PLANE2) Ben Widawsky
2017-06-23 16:45 ` [PATCH 1/4] drm: Plumb modifiers through plane init Ben Widawsky
2017-06-23 16:45 ` [PATCH 2/4] drm: Create a format/modifier blob Ben Widawsky
2017-06-29 19:49   ` Ville Syrjälä
2017-07-14 18:41     ` Ben Widawsky
2017-07-14 19:10       ` Ville Syrjälä
2017-07-21  4:20         ` Ben Widawsky [this message]
2017-06-23 16:45 ` [PATCH 3/4] drm/i915: Add format modifiers for Intel Ben Widawsky
2017-06-26 11:32   ` Emil Velikov
2017-06-29 19:59   ` Ville Syrjälä
2017-06-23 16:45 ` [PATCH 4/4] drm/i915: Add support for CCS modifiers Ben Widawsky
2017-06-29 20:02   ` Ville Syrjälä
2017-07-21 20:12     ` Ben Widawsky
2017-06-23 16:55 ` ✗ Fi.CI.BAT: failure for Blobifiers (FKA GET_PLANE2) Patchwork
2017-07-24  3:46 [PATCH 0/4] [v2] " Ben Widawsky
2017-07-24  3:46 ` [PATCH 2/4] drm: Create a format/modifier blob Ben Widawsky
2017-07-25  4:48   ` kbuild test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170721042032.GA15342@mail.bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hoegsberg@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=liviu@dudau.co.uk \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.