All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer
@ 2015-04-01 13:29 Tobias Jakobi
  2015-04-01 13:29 ` [PATCH 2/3] drm/exynos: remove superfluous error messages Tobias Jakobi
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Tobias Jakobi @ 2015-04-01 13:29 UTC (permalink / raw)
  To: linux-samsung-soc
  Cc: dri-devel, gustavo, jy0922.shim, inki.dae, Tobias Jakobi

Use the correct spelling for 'progressive'.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c  | 2 +-
 drivers/gpu/drm/exynos/exynos_mixer.c | 2 +-
 drivers/gpu/drm/exynos/regs-mixer.h   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 3511fcc..20e2ce7 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2022,7 +2022,7 @@ static void hdmi_mode_set(struct exynos_drm_display *display,
 	DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n",
 		m->hdisplay, m->vdisplay,
 		m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ?
-		"INTERLACED" : "PROGERESSIVE");
+		"INTERLACED" : "PROGRESSIVE");
 
 	/* preserve mode information for later use. */
 	drm_mode_copy(&hdata->current_mode, mode);
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index aa5b6e1..5ab0e32 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -267,7 +267,7 @@ static void mixer_cfg_scan(struct mixer_context *ctx, unsigned int height)
 
 	/* choosing between interlace and progressive mode */
 	val = (ctx->interlace ? MXR_CFG_SCAN_INTERLACE :
-				MXR_CFG_SCAN_PROGRASSIVE);
+				MXR_CFG_SCAN_PROGRESSIVE);
 
 	if (ctx->mxr_ver != MXR_VER_128_0_0_184) {
 		/* choosing between proper HD and SD mode */
diff --git a/drivers/gpu/drm/exynos/regs-mixer.h b/drivers/gpu/drm/exynos/regs-mixer.h
index 5f32e1a..ac60260 100644
--- a/drivers/gpu/drm/exynos/regs-mixer.h
+++ b/drivers/gpu/drm/exynos/regs-mixer.h
@@ -101,7 +101,7 @@
 #define MXR_CFG_GRP0_ENABLE		(1 << 4)
 #define MXR_CFG_VP_ENABLE		(1 << 3)
 #define MXR_CFG_SCAN_INTERLACE		(0 << 2)
-#define MXR_CFG_SCAN_PROGRASSIVE	(1 << 2)
+#define MXR_CFG_SCAN_PROGRESSIVE	(1 << 2)
 #define MXR_CFG_SCAN_NTSC		(0 << 1)
 #define MXR_CFG_SCAN_PAL		(1 << 1)
 #define MXR_CFG_SCAN_SD			(0 << 0)
-- 
2.0.5

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] drm/exynos: remove superfluous error messages
  2015-04-01 13:29 [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Tobias Jakobi
@ 2015-04-01 13:29 ` Tobias Jakobi
  2015-04-01 15:33   ` Gustavo Padovan
  2015-04-01 13:29 ` [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer Tobias Jakobi
  2015-04-01 15:33 ` [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Gustavo Padovan
  2 siblings, 1 reply; 8+ messages in thread
From: Tobias Jakobi @ 2015-04-01 13:29 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: dri-devel, Tobias Jakobi

The messages are redundant since 'check_fb_gem_memory_type'
already prints out exactly the same string when it fails.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_drm_fb.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index d346d1e..929cb03 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -151,10 +151,8 @@ exynos_drm_framebuffer_init(struct drm_device *dev,
 	exynos_gem_obj = to_exynos_gem_obj(obj);
 
 	ret = check_fb_gem_memory_type(dev, exynos_gem_obj);
-	if (ret < 0) {
-		DRM_ERROR("cannot use this gem memory type for fb.\n");
-		return ERR_PTR(-EINVAL);
-	}
+	if (ret < 0)
+		return ERR_PTR(ret);
 
 	exynos_fb = kzalloc(sizeof(*exynos_fb), GFP_KERNEL);
 	if (!exynos_fb)
@@ -250,10 +248,8 @@ exynos_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
 		exynos_fb->exynos_gem_obj[i] = exynos_gem_obj;
 
 		ret = check_fb_gem_memory_type(dev, exynos_gem_obj);
-		if (ret < 0) {
-			DRM_ERROR("cannot use this gem memory type for fb.\n");
+		if (ret < 0)
 			goto err_unreference;
-		}
 	}
 
 	ret = drm_framebuffer_init(dev, &exynos_fb->fb, &exynos_drm_fb_funcs);
-- 
2.0.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer
  2015-04-01 13:29 [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Tobias Jakobi
  2015-04-01 13:29 ` [PATCH 2/3] drm/exynos: remove superfluous error messages Tobias Jakobi
@ 2015-04-01 13:29 ` Tobias Jakobi
  2015-04-01 15:34   ` Gustavo Padovan
  2015-04-05 16:40   ` Emil Velikov
  2015-04-01 15:33 ` [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Gustavo Padovan
  2 siblings, 2 replies; 8+ messages in thread
From: Tobias Jakobi @ 2015-04-01 13:29 UTC (permalink / raw)
  To: linux-samsung-soc; +Cc: dri-devel, Tobias Jakobi

While the VP (video processor) supports arbitrary scaling
of its input, the mixer just supports a simple 2x (line
doubling) scaling. Expose this functionality and exit
early when an unsupported scaling configuration is
encountered.

This was tested with modetest's DRM plane test (from
the libdrm test suite) on an Odroid-X2 (Exynos4412).

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
---
 drivers/gpu/drm/exynos/exynos_mixer.c | 35 +++++++++++++++++++++++++++++------
 1 file changed, 29 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index 5ab0e32..6822b36 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -499,12 +499,36 @@ static void mixer_layer_update(struct mixer_context *ctx)
 	mixer_reg_writemask(res, MXR_CFG, ~0, MXR_CFG_LAYER_UPDATE);
 }
 
+static int mixer_setup_scale(const struct exynos_drm_plane *plane,
+		unsigned int *x_ratio, unsigned int *y_ratio)
+{
+	if (plane->crtc_width != plane->src_width) {
+		if (plane->crtc_width == 2 * plane->src_width)
+			*x_ratio = 1;
+		else
+			goto fail;
+	}
+
+	if (plane->crtc_height != plane->src_height) {
+		if (plane->crtc_height == 2 * plane->src_height)
+			*y_ratio = 1;
+		else
+			goto fail;
+	}
+
+	return 0;
+
+fail:
+	DRM_DEBUG_KMS("only 2x width/height scaling of plane supported\n");
+	return -ENOTSUPP;
+}
+
 static void mixer_graph_buffer(struct mixer_context *ctx, int win)
 {
 	struct mixer_resources *res = &ctx->mixer_res;
 	unsigned long flags;
 	struct exynos_drm_plane *plane;
-	unsigned int x_ratio, y_ratio;
+	unsigned int x_ratio = 0, y_ratio = 0;
 	unsigned int src_x_offset, src_y_offset, dst_x_offset, dst_y_offset;
 	dma_addr_t dma_addr;
 	unsigned int fmt;
@@ -528,9 +552,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
 		fmt = ARGB8888;
 	}
 
-	/* 2x scaling feature */
-	x_ratio = 0;
-	y_ratio = 0;
+	/* check if mixer supports requested scaling setup */
+	if (mixer_setup_scale(plane, &x_ratio, &y_ratio)) return;
 
 	dst_x_offset = plane->crtc_x;
 	dst_y_offset = plane->crtc_y;
@@ -566,8 +589,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
 		mixer_reg_write(res, MXR_RESOLUTION, val);
 	}
 
-	val  = MXR_GRP_WH_WIDTH(plane->crtc_width);
-	val |= MXR_GRP_WH_HEIGHT(plane->crtc_height);
+	val  = MXR_GRP_WH_WIDTH(plane->src_width);
+	val |= MXR_GRP_WH_HEIGHT(plane->src_height);
 	val |= MXR_GRP_WH_H_SCALE(x_ratio);
 	val |= MXR_GRP_WH_V_SCALE(y_ratio);
 	mixer_reg_write(res, MXR_GRAPHIC_WH(win), val);
-- 
2.0.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer
  2015-04-01 13:29 [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Tobias Jakobi
  2015-04-01 13:29 ` [PATCH 2/3] drm/exynos: remove superfluous error messages Tobias Jakobi
  2015-04-01 13:29 ` [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer Tobias Jakobi
@ 2015-04-01 15:33 ` Gustavo Padovan
  2 siblings, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-04-01 15:33 UTC (permalink / raw)
  To: Tobias Jakobi; +Cc: linux-samsung-soc, dri-devel, jy0922.shim, inki.dae

Hi Tobias,

2015-04-01 Tobias Jakobi <tjakobi@math.uni-bielefeld.de>:

> Use the correct spelling for 'progressive'.
> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos_hdmi.c  | 2 +-
>  drivers/gpu/drm/exynos/exynos_mixer.c | 2 +-
>  drivers/gpu/drm/exynos/regs-mixer.h   | 2 +-
>  3 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
 
	Gustavo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] drm/exynos: remove superfluous error messages
  2015-04-01 13:29 ` [PATCH 2/3] drm/exynos: remove superfluous error messages Tobias Jakobi
@ 2015-04-01 15:33   ` Gustavo Padovan
  0 siblings, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-04-01 15:33 UTC (permalink / raw)
  To: Tobias Jakobi; +Cc: linux-samsung-soc, dri-devel, jy0922.shim, inki.dae

Hi Tobias,

2015-04-01 Tobias Jakobi <tjakobi@math.uni-bielefeld.de>:

> The messages are redundant since 'check_fb_gem_memory_type'
> already prints out exactly the same string when it fails.
> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos_drm_fb.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

	Gustavo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer
  2015-04-01 13:29 ` [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer Tobias Jakobi
@ 2015-04-01 15:34   ` Gustavo Padovan
  2015-04-05 16:40   ` Emil Velikov
  1 sibling, 0 replies; 8+ messages in thread
From: Gustavo Padovan @ 2015-04-01 15:34 UTC (permalink / raw)
  To: Tobias Jakobi; +Cc: linux-samsung-soc, dri-devel, jy0922.shim, inki.dae

Hi Tobias,

2015-04-01 Tobias Jakobi <tjakobi@math.uni-bielefeld.de>:

> While the VP (video processor) supports arbitrary scaling
> of its input, the mixer just supports a simple 2x (line
> doubling) scaling. Expose this functionality and exit
> early when an unsupported scaling configuration is
> encountered.
> 
> This was tested with modetest's DRM plane test (from
> the libdrm test suite) on an Odroid-X2 (Exynos4412).
> 
> Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
> ---
>  drivers/gpu/drm/exynos/exynos_mixer.c | 35 +++++++++++++++++++++++++++++------
>  1 file changed, 29 insertions(+), 6 deletions(-)

Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

	Gustavo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer
  2015-04-01 13:29 ` [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer Tobias Jakobi
  2015-04-01 15:34   ` Gustavo Padovan
@ 2015-04-05 16:40   ` Emil Velikov
  2015-04-06 17:39     ` Tobias Jakobi
  1 sibling, 1 reply; 8+ messages in thread
From: Emil Velikov @ 2015-04-05 16:40 UTC (permalink / raw)
  To: Tobias Jakobi; +Cc: linux-samsung-soc, ML dri-devel

Hi Tobias,

On 1 April 2015 at 14:29, Tobias Jakobi <tjakobi@math.uni-bielefeld.de> wrote:
> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
> index 5ab0e32..6822b36 100644
> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c

> @@ -528,9 +552,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>                 fmt = ARGB8888;
>         }
>
> -       /* 2x scaling feature */
> -       x_ratio = 0;
> -       y_ratio = 0;
> +       /* check if mixer supports requested scaling setup */
> +       if (mixer_setup_scale(plane, &x_ratio, &y_ratio)) return;
>
Having return on the same line as the if statement will make
checkpatch.pl unhappy :-(

Cheers
Emil

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer
  2015-04-05 16:40   ` Emil Velikov
@ 2015-04-06 17:39     ` Tobias Jakobi
  0 siblings, 0 replies; 8+ messages in thread
From: Tobias Jakobi @ 2015-04-06 17:39 UTC (permalink / raw)
  To: Emil Velikov; +Cc: linux-samsung-soc, ML dri-devel

Hello Emil,

Emil Velikov wrote:
> Hi Tobias,
> 
> On 1 April 2015 at 14:29, Tobias Jakobi <tjakobi@math.uni-bielefeld.de> wrote:
>> diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
>> index 5ab0e32..6822b36 100644
>> --- a/drivers/gpu/drm/exynos/exynos_mixer.c
>> +++ b/drivers/gpu/drm/exynos/exynos_mixer.c
> 
>> @@ -528,9 +552,8 @@ static void mixer_graph_buffer(struct mixer_context *ctx, int win)
>>                 fmt = ARGB8888;
>>         }
>>
>> -       /* 2x scaling feature */
>> -       x_ratio = 0;
>> -       y_ratio = 0;
>> +       /* check if mixer supports requested scaling setup */
>> +       if (mixer_setup_scale(plane, &x_ratio, &y_ratio)) return;
>>
> Having return on the same line as the if statement will make
> checkpatch.pl unhappy :-(
right, I'm going to fix this and resend the series.

With best wishes,
Tobias

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-04-06 17:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-01 13:29 [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Tobias Jakobi
2015-04-01 13:29 ` [PATCH 2/3] drm/exynos: remove superfluous error messages Tobias Jakobi
2015-04-01 15:33   ` Gustavo Padovan
2015-04-01 13:29 ` [PATCH 3/3] drm/exynos: mixer: add 2x scaling to mixer_graph_buffer Tobias Jakobi
2015-04-01 15:34   ` Gustavo Padovan
2015-04-05 16:40   ` Emil Velikov
2015-04-06 17:39     ` Tobias Jakobi
2015-04-01 15:33 ` [PATCH 1/3] drm/exynos: fix typos in hdmi and mixer Gustavo Padovan

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.