All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: [PATCH v3 02/11] media: vsp1: Remove packed attributes from aligned structures
Date: Thu,  3 May 2018 09:44:13 +0100	[thread overview]
Message-ID: <238453e87f66208399a9e3626489df08bf265282.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com> (raw)
In-Reply-To: <cover.a15c17beeb074afaf226d19ff3c4fdba2f647500.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com>
In-Reply-To: <cover.a15c17beeb074afaf226d19ff3c4fdba2f647500.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com>

The use of the packed attribute can cause a performance penalty for
all accesses to the struct members, as the compiler will assume that the
structure has the potential to have an unaligned base.

These structures are all correctly aligned and contain no holes, thus
the attribute is redundant and negatively impacts performance, so we
remove the attributes entirely.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
v2
 - Remove attributes entirely

 drivers/media/platform/vsp1/vsp1_dl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index ce6cb210adcd..b6288ead24ae 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -25,19 +25,19 @@
 struct vsp1_dl_header_list {
 	u32 num_bytes;
 	u32 addr;
-} __attribute__((__packed__));
+};
 
 struct vsp1_dl_header {
 	u32 num_lists;
 	struct vsp1_dl_header_list lists[8];
 	u32 next_header;
 	u32 flags;
-} __attribute__((__packed__));
+};
 
 struct vsp1_dl_entry {
 	u32 addr;
 	u32 data;
-} __attribute__((__packed__));
+};
 
 /**
  * struct vsp1_dl_body - Display list body
-- 
git-series 0.9.1

WARNING: multiple messages have this Message-ID (diff)
From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Subject: [PATCH v3 02/11] media: vsp1: Remove packed attributes from aligned structures
Date: Thu,  3 May 2018 09:44:13 +0100	[thread overview]
Message-ID: <238453e87f66208399a9e3626489df08bf265282.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com> (raw)
In-Reply-To: <cover.a15c17beeb074afaf226d19ff3c4fdba2f647500.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com>
In-Reply-To: <cover.a15c17beeb074afaf226d19ff3c4fdba2f647500.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com>

The use of the packed attribute can cause a performance penalty for
all accesses to the struct members, as the compiler will assume that the
structure has the potential to have an unaligned base.

These structures are all correctly aligned and contain no holes, thus
the attribute is redundant and negatively impacts performance, so we
remove the attributes entirely.

Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
v2
 - Remove attributes entirely

 drivers/media/platform/vsp1/vsp1_dl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/platform/vsp1/vsp1_dl.c b/drivers/media/platform/vsp1/vsp1_dl.c
index ce6cb210adcd..b6288ead24ae 100644
--- a/drivers/media/platform/vsp1/vsp1_dl.c
+++ b/drivers/media/platform/vsp1/vsp1_dl.c
@@ -25,19 +25,19 @@
 struct vsp1_dl_header_list {
 	u32 num_bytes;
 	u32 addr;
-} __attribute__((__packed__));
+};
 
 struct vsp1_dl_header {
 	u32 num_lists;
 	struct vsp1_dl_header_list lists[8];
 	u32 next_header;
 	u32 flags;
-} __attribute__((__packed__));
+};
 
 struct vsp1_dl_entry {
 	u32 addr;
 	u32 data;
-} __attribute__((__packed__));
+};
 
 /**
  * struct vsp1_dl_body - Display list body
-- 
git-series 0.9.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-05-03  8:44 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-03  8:44 [PATCH v3 00/11] R-Car DU Interlaced support through VSP1 Kieran Bingham
2018-05-03  8:44 ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 01/11] media: vsp1: drm: Fix minor grammar error Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` Kieran Bingham [this message]
2018-05-03  8:44   ` [PATCH v3 02/11] media: vsp1: Remove packed attributes from aligned structures Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 03/11] media: vsp1: Rename dl_child to dl_next Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 04/11] media: vsp1: Remove unused display list structure field Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 05/11] media: vsp1: Clean up DLM objects on error Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 06/11] media: vsp1: Provide VSP1 feature helper macro Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 07/11] media: vsp1: Use header display lists for all WPF outputs linked to the DU Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 08/11] media: vsp1: Add support for extended display list headers Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 09/11] media: vsp1: Provide support for extended command pools Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  8:44 ` [PATCH v3 10/11] media: vsp1: Support Interlaced display pipelines Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham
2018-05-03  9:04   ` Kieran Bingham
2018-05-03  9:04     ` Kieran Bingham
2018-05-03 11:13     ` Laurent Pinchart
2018-05-03 11:13       ` Laurent Pinchart
2018-05-03 13:45       ` Kieran Bingham
2018-05-03 13:45         ` Kieran Bingham
2018-05-24 10:08         ` Laurent Pinchart
2018-05-24 10:08           ` Laurent Pinchart
2018-05-03  8:44 ` [PATCH v3 11/11] drm: rcar-du: Support interlaced video output through vsp1 Kieran Bingham
2018-05-03  8:44   ` Kieran Bingham

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=238453e87f66208399a9e3626489df08bf265282.1525336865.git-series.kieran.bingham+renesas@ideasonboard.com \
    --to=kieran.bingham+renesas@ideasonboard.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    /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.