Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1560784 > unrolled thread

[PATCH 0/8] drm/mali-dp: Fixes for v4.11

Started byLiviu Dudau <Liviu.Dudau@arm.com>
First post2017-01-17 17:40 +0100
Last post2017-01-17 17:50 +0100
Articles 9 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/8] drm/mali-dp: Fixes for v4.11 Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:40 +0100
    [PATCH 5/8] drm: mali-dp: Fix destination size handling when rotating Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:40 +0100
    [PATCH 4/8] drm: mali-dp: Don't force source size == crtc size Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100
    [PATCH 2/8] drm: malidp: Remove event_list member from struct malidp_drm Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100
    [PATCH 1/8] drm/arm/malidp: Fix possible dereference of NULL Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100
    [PATCH 7/8] drm: mali-dp: fix Lx_CONTROL register fields clobber Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100
    [PATCH 3/8] drm: mali-dp: Check more use cases in the plane's ->atomic_check() Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100
    [PATCH 8/8] drm: mali-dp: Rename malidp_input_format to malidp_pixel_format Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100
    [PATCH 6/8] drm: mali-dp: Fix transposed horizontal/vertical flip Liviu Dudau <Liviu.Dudau@arm.com> - 2017-01-17 17:50 +0100

#1560784 — [PATCH 0/8] drm/mali-dp: Fixes for v4.11

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:40 +0100
Subject[PATCH 0/8] drm/mali-dp: Fixes for v4.11
Message-ID<t0EXE-VQ-31@gated-at.bofh.it>
Hello,

Here is the collected list of patches that I have accumulated since last
December in my inbox. They are offered for review and comments before
I commit them to the mali-dp tree and they get added to linux-next.

Best regards,
Liviu

Brian Starkey (4):
  drm: mali-dp: Don't force source size == crtc size
  drm: mali-dp: Fix destination size handling when rotating
  drm: mali-dp: Fix transposed horizontal/vertical flip
  drm: mali-dp: Rename malidp_input_format to malidp_pixel_format

Liviu Dudau (2):
  drm: malidp: Remove event_list member from struct malidp_drm
  drm: mali-dp: Check more use cases in the plane's ->atomic_check()

Mihail Atanassov (1):
  drm: mali-dp: fix Lx_CONTROL register fields clobber

Shailendra Verma (1):
  drm/arm/malidp: Fix possible dereference of NULL

 drivers/gpu/drm/arm/malidp_drv.c    |  2 --
 drivers/gpu/drm/arm/malidp_drv.h    |  2 +-
 drivers/gpu/drm/arm/malidp_hw.c     | 24 ++++++++--------
 drivers/gpu/drm/arm/malidp_hw.h     |  8 +++---
 drivers/gpu/drm/arm/malidp_planes.c | 57 +++++++++++++++++++++----------------
 5 files changed, 50 insertions(+), 43 deletions(-)

-- 
2.11.0

[toc] | [next] | [standalone]


#1560789 — [PATCH 5/8] drm: mali-dp: Fix destination size handling when rotating

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:40 +0100
Subject[PATCH 5/8] drm: mali-dp: Fix destination size handling when rotating
Message-ID<t0EXF-VQ-37@gated-at.bofh.it>
In reply to#1560784
From: Brian Starkey <brian.starkey@arm.com>

The destination rectangle provided by userspace in the CRTC_X/Y/W/H
properties is already expressed as the dimensions after rotation.
This means we shouldn't swap the width and height ourselves when a
90/270 degree rotation is requested, so remove the code doing the swap.

Fixes: ad49f8602fe8 ("drm/arm: Add support for Mali Display Processors")

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 69eba71253c9..8c5ce36147f3 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -187,13 +187,8 @@ static void malidp_de_plane_update(struct drm_plane *plane,
 	/* convert src values from Q16 fixed point to integer */
 	src_w = plane->state->src_w >> 16;
 	src_h = plane->state->src_h >> 16;
-	if (plane->state->rotation & MALIDP_ROTATED_MASK) {
-		dest_w = plane->state->crtc_h;
-		dest_h = plane->state->crtc_w;
-	} else {
-		dest_w = plane->state->crtc_w;
-		dest_h = plane->state->crtc_h;
-	}
+	dest_w = plane->state->crtc_w;
+	dest_h = plane->state->crtc_h;
 
 	malidp_hw_write(mp->hwdev, ms->format, mp->layer->base);
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560792 — [PATCH 4/8] drm: mali-dp: Don't force source size == crtc size

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 4/8] drm: mali-dp: Don't force source size == crtc size
Message-ID<t0F7k-Zg-7@gated-at.bofh.it>
In reply to#1560784
From: Brian Starkey <brian.starkey@arm.com>

Remove the check enforcing that src_w and src_h match crtc_w and crtc_h,
as this prevents rotation from working.

The check was intended to disallow scaling, but
drm_plane_helper_check_state() does that for us, while also taking
rotation into account, so the removed check was redundant in any case.

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Liviu Dudau <liviu.dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index f684fe4a80d2..69eba71253c9 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -135,8 +135,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
 	if ((state->crtc_w > mp->hwdev->max_line_size) ||
 	    (state->crtc_h > mp->hwdev->max_line_size) ||
 	    (state->crtc_w < mp->hwdev->min_line_size) ||
-	    (state->crtc_h < mp->hwdev->min_line_size) ||
-	    (state->crtc_w != src_w) || (state->crtc_h != src_h))
+	    (state->crtc_h < mp->hwdev->min_line_size))
 		return -EINVAL;
 
 	/* packed RGB888 / BGR888 can't be rotated or flipped */
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560798 — [PATCH 2/8] drm: malidp: Remove event_list member from struct malidp_drm

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 2/8] drm: malidp: Remove event_list member from struct malidp_drm
Message-ID<t0F7k-Zg-9@gated-at.bofh.it>
In reply to#1560784
This struct member managed to outlive the submission process without
being removed. It is useless.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_drv.c | 2 --
 drivers/gpu/drm/arm/malidp_drv.h | 2 +-
 2 files changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_drv.c b/drivers/gpu/drm/arm/malidp_drv.c
index 32f746e31379..080f7631c672 100644
--- a/drivers/gpu/drm/arm/malidp_drv.c
+++ b/drivers/gpu/drm/arm/malidp_drv.c
@@ -22,7 +22,6 @@
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_crtc_helper.h>
-#include <drm/drm_fb_helper.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
 #include <drm/drm_of.h>
@@ -286,7 +285,6 @@ static int malidp_bind(struct device *dev)
 	memcpy(hwdev, of_device_get_match_data(dev), sizeof(*hwdev));
 	malidp->dev = hwdev;
 
-	INIT_LIST_HEAD(&malidp->event_list);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	hwdev->regs = devm_ioremap_resource(dev, res);
diff --git a/drivers/gpu/drm/arm/malidp_drv.h b/drivers/gpu/drm/arm/malidp_drv.h
index 9fc8a2e405e4..dbc617c6e4ef 100644
--- a/drivers/gpu/drm/arm/malidp_drv.h
+++ b/drivers/gpu/drm/arm/malidp_drv.h
@@ -15,12 +15,12 @@
 
 #include <linux/mutex.h>
 #include <linux/wait.h>
+#include <drm/drmP.h>
 #include "malidp_hw.h"
 
 struct malidp_drm {
 	struct malidp_hw_device *dev;
 	struct drm_fbdev_cma *fbdev;
-	struct list_head event_list;
 	struct drm_crtc crtc;
 	wait_queue_head_t wq;
 	atomic_t config_valid;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560800 — [PATCH 1/8] drm/arm/malidp: Fix possible dereference of NULL

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 1/8] drm/arm/malidp: Fix possible dereference of NULL
Message-ID<t0F7k-Zg-15@gated-at.bofh.it>
In reply to#1560784
From: Shailendra Verma <shailendra.v@samsung.com>

There is possible deference of NULL pointer on return of
malidp_duplicate_plane_state() if kmalloc fails. Check the
returned kmalloc pointer before continuing.

Signed-off-by: Shailendra Verma <Shailendra.v@samsung.com>
[cleaned up the code and re-formatted the commit message]
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index eff2fe47e26a..d1cc15724dc3 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -67,13 +67,14 @@ drm_plane_state *malidp_duplicate_plane_state(struct drm_plane *plane)
 		return NULL;
 
 	state = kmalloc(sizeof(*state), GFP_KERNEL);
-	if (state) {
-		m_state = to_malidp_plane_state(plane->state);
-		__drm_atomic_helper_plane_duplicate_state(plane, &state->base);
-		state->rotmem_size = m_state->rotmem_size;
-		state->format = m_state->format;
-		state->n_planes = m_state->n_planes;
-	}
+	if (!state)
+		return NULL;
+
+	m_state = to_malidp_plane_state(plane->state);
+	__drm_atomic_helper_plane_duplicate_state(plane, &state->base);
+	state->rotmem_size = m_state->rotmem_size;
+	state->format = m_state->format;
+	state->n_planes = m_state->n_planes;
 
 	return &state->base;
 }
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560801 — [PATCH 7/8] drm: mali-dp: fix Lx_CONTROL register fields clobber

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 7/8] drm: mali-dp: fix Lx_CONTROL register fields clobber
Message-ID<t0F7k-Zg-21@gated-at.bofh.it>
In reply to#1560784
From: Mihail Atanassov <mihail.atanassov@arm.com>

When updating the rotation fields, one of the assignments zeroes out the
rest of the register fields, which include settings for chroma siting,
inverse gamma, AMBA AXI caching, and alpha blending.

Signed-off-by: Mihail Atanassov <mihail.atanassov@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 629f634872a4..1db8b6977efc 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -219,7 +219,8 @@ static void malidp_de_plane_update(struct drm_plane *plane,
 
 	/* setup the rotation and axis flip bits */
 	if (plane->state->rotation & DRM_ROTATE_MASK)
-		val = ilog2(plane->state->rotation & DRM_ROTATE_MASK) << LAYER_ROT_OFFSET;
+		val |= ilog2(plane->state->rotation & DRM_ROTATE_MASK) <<
+		       LAYER_ROT_OFFSET;
 	if (plane->state->rotation & DRM_REFLECT_X)
 		val |= LAYER_H_FLIP;
 	if (plane->state->rotation & DRM_REFLECT_Y)
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560804 — [PATCH 3/8] drm: mali-dp: Check more use cases in the plane's ->atomic_check()

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 3/8] drm: mali-dp: Check more use cases in the plane's ->atomic_check()
Message-ID<t0F7l-Zg-29@gated-at.bofh.it>
In reply to#1560784
Mali DP's plane ->atomic_check() only checks for the new state submitting
frame buffers with supported pixel formats and if there is enough
rotation memory for rotated planes. Add a call to
drm_plane_helper_check_state() to add additional checks for plane
state validity and clipping issues.

Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index d1cc15724dc3..f684fe4a80d2 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -11,6 +11,7 @@
  */
 
 #include <drm/drmP.h>
+#include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
 #include <drm/drm_fb_cma_helper.h>
 #include <drm/drm_gem_cma_helper.h>
@@ -103,8 +104,10 @@ static int malidp_de_plane_check(struct drm_plane *plane,
 {
 	struct malidp_plane *mp = to_malidp_plane(plane);
 	struct malidp_plane_state *ms = to_malidp_plane_state(state);
+	struct drm_crtc_state *crtc_state;
 	struct drm_framebuffer *fb;
-	int i;
+	struct drm_rect clip = { 0 };
+	int i, ret;
 	u32 src_w, src_h;
 
 	if (!state->crtc || !state->fb)
@@ -142,6 +145,16 @@ static int malidp_de_plane_check(struct drm_plane *plane,
 	     fb->format->format == DRM_FORMAT_BGR888))
 		return -EINVAL;
 
+	crtc_state = drm_atomic_get_existing_crtc_state(state->state, state->crtc);
+	clip.x2 = crtc_state->adjusted_mode.hdisplay;
+	clip.y2 = crtc_state->adjusted_mode.vdisplay;
+	ret = drm_plane_helper_check_state(state, &clip,
+					   DRM_PLANE_HELPER_NO_SCALING,
+					   DRM_PLANE_HELPER_NO_SCALING,
+					   true, true);
+	if (ret)
+		return ret;
+
 	ms->rotmem_size = 0;
 	if (state->rotation & MALIDP_ROTATED_MASK) {
 		int val;
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560805 — [PATCH 8/8] drm: mali-dp: Rename malidp_input_format to malidp_pixel_format

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 8/8] drm: mali-dp: Rename malidp_input_format to malidp_pixel_format
Message-ID<t0F7l-Zg-35@gated-at.bofh.it>
In reply to#1560784
From: Brian Starkey <brian.starkey@arm.com>

We're going to use the same format list for output formats, so rename
everything related to input formats to avoid confusion.

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
[touched commit message to clarify the final struct name]
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_hw.c     | 24 ++++++++++++------------
 drivers/gpu/drm/arm/malidp_hw.h     |  8 ++++----
 drivers/gpu/drm/arm/malidp_planes.c |  8 ++++----
 3 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c
index 4bdf531f7844..9ec6d6904f5e 100644
--- a/drivers/gpu/drm/arm/malidp_hw.c
+++ b/drivers/gpu/drm/arm/malidp_hw.c
@@ -21,7 +21,7 @@
 #include "malidp_drv.h"
 #include "malidp_hw.h"
 
-static const struct malidp_input_format malidp500_de_formats[] = {
+static const struct malidp_format_id malidp500_de_formats[] = {
 	/*    fourcc,   layers supporting the format,     internal id  */
 	{ DRM_FORMAT_ARGB2101010, DE_VIDEO1 | DE_GRAPHICS1 | DE_GRAPHICS2,  0 },
 	{ DRM_FORMAT_ABGR2101010, DE_VIDEO1 | DE_GRAPHICS1 | DE_GRAPHICS2,  1 },
@@ -69,7 +69,7 @@ static const struct malidp_input_format malidp500_de_formats[] = {
 	{ DRM_FORMAT_NV12, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 6) },	\
 	{ DRM_FORMAT_YUV420, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 7) }
 
-static const struct malidp_input_format malidp550_de_formats[] = {
+static const struct malidp_format_id malidp550_de_formats[] = {
 	MALIDP_COMMON_FORMATS,
 };
 
@@ -436,8 +436,8 @@ const struct malidp_hw_device malidp_device[MALIDP_MAX_DEVICES] = {
 				.irq_mask = MALIDP500_DE_IRQ_CONF_VALID,
 				.vsync_irq = MALIDP500_DE_IRQ_CONF_VALID,
 			},
-			.input_formats = malidp500_de_formats,
-			.n_input_formats = ARRAY_SIZE(malidp500_de_formats),
+			.pixel_formats = malidp500_de_formats,
+			.n_pixel_formats = ARRAY_SIZE(malidp500_de_formats),
 			.bus_align_bytes = 8,
 		},
 		.query_hw = malidp500_query_hw,
@@ -469,8 +469,8 @@ const struct malidp_hw_device malidp_device[MALIDP_MAX_DEVICES] = {
 				.irq_mask = MALIDP550_DC_IRQ_CONF_VALID,
 				.vsync_irq = MALIDP550_DC_IRQ_CONF_VALID,
 			},
-			.input_formats = malidp550_de_formats,
-			.n_input_formats = ARRAY_SIZE(malidp550_de_formats),
+			.pixel_formats = malidp550_de_formats,
+			.n_pixel_formats = ARRAY_SIZE(malidp550_de_formats),
 			.bus_align_bytes = 8,
 		},
 		.query_hw = malidp550_query_hw,
@@ -503,8 +503,8 @@ const struct malidp_hw_device malidp_device[MALIDP_MAX_DEVICES] = {
 				.irq_mask = MALIDP550_DC_IRQ_CONF_VALID,
 				.vsync_irq = MALIDP550_DC_IRQ_CONF_VALID,
 			},
-			.input_formats = malidp550_de_formats,
-			.n_input_formats = ARRAY_SIZE(malidp550_de_formats),
+			.pixel_formats = malidp550_de_formats,
+			.n_pixel_formats = ARRAY_SIZE(malidp550_de_formats),
 			.bus_align_bytes = 16,
 		},
 		.query_hw = malidp650_query_hw,
@@ -522,10 +522,10 @@ u8 malidp_hw_get_format_id(const struct malidp_hw_regmap *map,
 {
 	unsigned int i;
 
-	for (i = 0; i < map->n_input_formats; i++) {
-		if (((map->input_formats[i].layer & layer_id) == layer_id) &&
-		    (map->input_formats[i].format == format))
-			return map->input_formats[i].id;
+	for (i = 0; i < map->n_pixel_formats; i++) {
+		if (((map->pixel_formats[i].layer & layer_id) == layer_id) &&
+		    (map->pixel_formats[i].format == format))
+			return map->pixel_formats[i].id;
 	}
 
 	return MALIDP_INVALID_FORMAT_ID;
diff --git a/drivers/gpu/drm/arm/malidp_hw.h b/drivers/gpu/drm/arm/malidp_hw.h
index 087e1202db3d..4f8c884d1960 100644
--- a/drivers/gpu/drm/arm/malidp_hw.h
+++ b/drivers/gpu/drm/arm/malidp_hw.h
@@ -35,7 +35,7 @@ enum {
 	DE_SMART = BIT(4),
 };
 
-struct malidp_input_format {
+struct malidp_format_id {
 	u32 format;		/* DRM fourcc */
 	u8 layer;		/* bitmask of layers supporting it */
 	u8 id;			/* used internally */
@@ -85,9 +85,9 @@ struct malidp_hw_regmap {
 	const struct malidp_irq_map se_irq_map;
 	const struct malidp_irq_map dc_irq_map;
 
-	/* list of supported input formats for each layer */
-	const struct malidp_input_format *input_formats;
-	const u8 n_input_formats;
+	/* list of supported pixel formats for each layer */
+	const struct malidp_format_id *pixel_formats;
+	const u8 n_pixel_formats;
 
 	/* pitch alignment requirement in bytes */
 	const u8 bus_align_bytes;
diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 1db8b6977efc..8845647d5bef 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -267,7 +267,7 @@ int malidp_de_planes_init(struct drm_device *drm)
 	u32 *formats;
 	int ret, i, j, n;
 
-	formats = kcalloc(map->n_input_formats, sizeof(*formats), GFP_KERNEL);
+	formats = kcalloc(map->n_pixel_formats, sizeof(*formats), GFP_KERNEL);
 	if (!formats) {
 		ret = -ENOMEM;
 		goto cleanup;
@@ -283,9 +283,9 @@ int malidp_de_planes_init(struct drm_device *drm)
 		}
 
 		/* build the list of DRM supported formats based on the map */
-		for (n = 0, j = 0;  j < map->n_input_formats; j++) {
-			if ((map->input_formats[j].layer & id) == id)
-				formats[n++] = map->input_formats[j].format;
+		for (n = 0, j = 0;  j < map->n_pixel_formats; j++) {
+			if ((map->pixel_formats[j].layer & id) == id)
+				formats[n++] = map->pixel_formats[j].format;
 		}
 
 		plane_type = (i == 0) ? DRM_PLANE_TYPE_PRIMARY :
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1560809 — [PATCH 6/8] drm: mali-dp: Fix transposed horizontal/vertical flip

FromLiviu Dudau <Liviu.Dudau@arm.com>
Date2017-01-17 17:50 +0100
Subject[PATCH 6/8] drm: mali-dp: Fix transposed horizontal/vertical flip
Message-ID<t0F7l-Zg-39@gated-at.bofh.it>
In reply to#1560784
From: Brian Starkey <brian.starkey@arm.com>

The horizontal and vertical flip flags were the wrong way around,
causing reflect-x to result in reflect-y being applied and vice-versa.
Fix them.

Fixes: ad49f8602fe8 ("drm/arm: Add support for Mali Display Processors")

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Liviu Dudau <Liviu.Dudau@arm.com>
---
 drivers/gpu/drm/arm/malidp_planes.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 8c5ce36147f3..629f634872a4 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -221,9 +221,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,
 	if (plane->state->rotation & DRM_ROTATE_MASK)
 		val = ilog2(plane->state->rotation & DRM_ROTATE_MASK) << LAYER_ROT_OFFSET;
 	if (plane->state->rotation & DRM_REFLECT_X)
-		val |= LAYER_V_FLIP;
-	if (plane->state->rotation & DRM_REFLECT_Y)
 		val |= LAYER_H_FLIP;
+	if (plane->state->rotation & DRM_REFLECT_Y)
+		val |= LAYER_V_FLIP;
 
 	/*
 	 * always enable pixel alpha blending until we have a way to change
-- 
2.11.0

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web