public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Make num_pipes a per-pipe value
@ 2014-02-12 20:39 Damien Lespiau
  2014-02-13  9:22 ` Jani Nikula
  0 siblings, 1 reply; 2+ messages in thread
From: Damien Lespiau @ 2014-02-12 20:39 UTC (permalink / raw)
  To: intel-gfx

In the future, we need to be able to specify per-pipe number of planes.
Let's start today!

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/i915_dma.c      | 14 +++++++++++---
 drivers/gpu/drm/i915/i915_drv.h      |  4 ++--
 drivers/gpu/drm/i915/intel_display.c |  4 ++--
 3 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 1d65dbd..ba2e0e5 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1479,9 +1479,17 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
 
 	info = (struct intel_device_info *)&dev_priv->info;
 
-	info->num_sprites = 1;
-	if (IS_VALLEYVIEW(dev))
-		info->num_sprites = 2;
+	if (IS_VALLEYVIEW(dev)) {
+		info->num_sprites[PIPE_A] = 2;
+		info->num_sprites[PIPE_B] = 2;
+	} else {
+		if (info->num_pipes >= 1)
+			info->num_sprites[PIPE_A] = 1;
+		if (info->num_pipes >= 2)
+			info->num_sprites[PIPE_B] = 1;
+		if (info->num_pipes >= 3)
+			info->num_sprites[PIPE_C] = 1;
+	}
 
 	if (i915.disable_display) {
 		DRM_INFO("Display disabled (module parameter)\n");
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2572a95..c14de43 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -79,7 +79,7 @@ enum plane {
 };
 #define plane_name(p) ((p) + 'A')
 
-#define sprite_name(p, s) ((p) * INTEL_INFO(dev)->num_sprites + (s) + 'A')
+#define sprite_name(p, s) ((p) * INTEL_INFO(dev)->num_sprites[p] + (s) + 'A')
 
 enum port {
 	PORT_A = 0,
@@ -534,7 +534,7 @@ struct intel_uncore {
 struct intel_device_info {
 	u32 display_mmio_offset;
 	u8 num_pipes:3;
-	u8 num_sprites:2;
+	u8 num_sprites[I915_MAX_PIPES];
 	u8 gen;
 	u8 ring_mask; /* Rings supported by the HW */
 	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG, SEP_SEMICOLON);
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 63d37d6..c62d5d5 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1189,7 +1189,7 @@ static void assert_sprites_disabled(struct drm_i915_private *dev_priv,
 	u32 val;
 
 	if (IS_VALLEYVIEW(dev)) {
-		for (i = 0; i < INTEL_INFO(dev)->num_sprites; i++) {
+		for (i = 0; i < INTEL_INFO(dev)->num_sprites[i]; i++) {
 			reg = SPCNTR(pipe, i);
 			val = I915_READ(reg);
 			WARN((val & SP_ENABLE),
@@ -11064,7 +11064,7 @@ void intel_modeset_init(struct drm_device *dev)
 
 	for_each_pipe(i) {
 		intel_crtc_init(dev, i);
-		for (j = 0; j < INTEL_INFO(dev)->num_sprites; j++) {
+		for (j = 0; j < INTEL_INFO(dev)->num_sprites[i]; j++) {
 			ret = intel_plane_init(dev, i, j);
 			if (ret)
 				DRM_DEBUG_KMS("pipe %c sprite %c init failed: %d\n",
-- 
1.8.3.1

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

* Re: [PATCH] drm/i915: Make num_pipes a per-pipe value
  2014-02-12 20:39 [PATCH] drm/i915: Make num_pipes a per-pipe value Damien Lespiau
@ 2014-02-13  9:22 ` Jani Nikula
  0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2014-02-13  9:22 UTC (permalink / raw)
  To: Damien Lespiau, intel-gfx

On Wed, 12 Feb 2014, Damien Lespiau <damien.lespiau@intel.com> wrote:
> In the future, we need to be able to specify per-pipe number of planes.
> Let's start today!
>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_dma.c      | 14 +++++++++++---
>  drivers/gpu/drm/i915/i915_drv.h      |  4 ++--
>  drivers/gpu/drm/i915/intel_display.c |  4 ++--
>  3 files changed, 15 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 1d65dbd..ba2e0e5 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1479,9 +1479,17 @@ static void intel_device_info_runtime_init(struct drm_device *dev)
>  
>  	info = (struct intel_device_info *)&dev_priv->info;
>  
> -	info->num_sprites = 1;
> -	if (IS_VALLEYVIEW(dev))
> -		info->num_sprites = 2;
> +	if (IS_VALLEYVIEW(dev)) {
> +		info->num_sprites[PIPE_A] = 2;
> +		info->num_sprites[PIPE_B] = 2;
> +	} else {
> +		if (info->num_pipes >= 1)
> +			info->num_sprites[PIPE_A] = 1;
> +		if (info->num_pipes >= 2)
> +			info->num_sprites[PIPE_B] = 1;
> +		if (info->num_pipes >= 3)
> +			info->num_sprites[PIPE_C] = 1;
> +	}
>  
>  	if (i915.disable_display) {
>  		DRM_INFO("Display disabled (module parameter)\n");
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 2572a95..c14de43 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -79,7 +79,7 @@ enum plane {
>  };
>  #define plane_name(p) ((p) + 'A')
>  
> -#define sprite_name(p, s) ((p) * INTEL_INFO(dev)->num_sprites + (s) + 'A')
> +#define sprite_name(p, s) ((p) * INTEL_INFO(dev)->num_sprites[p] + (s) + 'A')
>  
>  enum port {
>  	PORT_A = 0,
> @@ -534,7 +534,7 @@ struct intel_uncore {
>  struct intel_device_info {
>  	u32 display_mmio_offset;
>  	u8 num_pipes:3;
> -	u8 num_sprites:2;
> +	u8 num_sprites[I915_MAX_PIPES];
>  	u8 gen;
>  	u8 ring_mask; /* Rings supported by the HW */
>  	DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG, SEP_SEMICOLON);
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 63d37d6..c62d5d5 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1189,7 +1189,7 @@ static void assert_sprites_disabled(struct drm_i915_private *dev_priv,
>  	u32 val;
>  
>  	if (IS_VALLEYVIEW(dev)) {
> -		for (i = 0; i < INTEL_INFO(dev)->num_sprites; i++) {
> +		for (i = 0; i < INTEL_INFO(dev)->num_sprites[i]; i++) {

This can't be right.

Jani.

>  			reg = SPCNTR(pipe, i);
>  			val = I915_READ(reg);
>  			WARN((val & SP_ENABLE),
> @@ -11064,7 +11064,7 @@ void intel_modeset_init(struct drm_device *dev)
>  
>  	for_each_pipe(i) {
>  		intel_crtc_init(dev, i);
> -		for (j = 0; j < INTEL_INFO(dev)->num_sprites; j++) {
> +		for (j = 0; j < INTEL_INFO(dev)->num_sprites[i]; j++) {
>  			ret = intel_plane_init(dev, i, j);
>  			if (ret)
>  				DRM_DEBUG_KMS("pipe %c sprite %c init failed: %d\n",
> -- 
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Jani Nikula, Intel Open Source Technology Center

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

end of thread, other threads:[~2014-02-13  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 20:39 [PATCH] drm/i915: Make num_pipes a per-pipe value Damien Lespiau
2014-02-13  9:22 ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox