All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu] Add radeon_is_gpu_screen helper
@ 2016-11-28  8:51 Michel Dänzer
       [not found] ` <20161128085139.30426-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2016-11-28  8:51 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

This will hopefully decrease the chance of accidentally breaking the
build against xserver < 1.13 in the future.

(Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/amdgpu_drv.h      |  3 +++
 src/amdgpu_kms.c      | 14 +++-----------
 src/drmmode_display.c |  6 ++----
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index ebfca8c..4eb4cf4 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -149,6 +149,9 @@ typedef enum {
 
 #if XF86_CRTC_VERSION >= 5
 #define AMDGPU_PIXMAP_SHARING 1
+#define amdgpu_is_gpu_screen(screen) (screen)->isGPU
+#else
+#define amdgpu_is_gpu_screen(screen) 0
 #endif
 
 #define AMDGPU_VSYNC_TIMEOUT	20000	/* Maximum wait for VSYNC (in usecs) */
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 18d2abb..bc48ca6 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -237,10 +237,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
 	if (dixPrivateKeyRegistered(rrPrivKey)) {
 		rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
 
-		if (
-#ifdef AMDGPU_PIXMAP_SHARING
-		    !pScreen->isGPU &&
-#endif
+		if (!amdgpu_is_gpu_screen(pScreen) &&
 		    !rrScrPriv->primaryOutput)
 		{
 			xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
@@ -277,10 +274,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
 		amdgpu_glamor_create_screen_resources(pScreen);
 
 	info->callback_event_type = -1;
-	if (
-#ifdef AMDGPU_PIXMAP_SHARING
-		!pScreen->isGPU &&
-#endif
+	if (!amdgpu_is_gpu_screen(pScreen) &&
 		(damage_ext = CheckExtension("DAMAGE"))) {
 		info->callback_event_type = damage_ext->eventBase + XDamageNotify;
 
@@ -1001,9 +995,7 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 	(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
 	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
 
-#ifdef AMDGPU_PIXMAP_SHARING
-	if (!pScreen->isGPU)
-#endif
+	if (!amdgpu_is_gpu_screen(pScreen))
 	{
 		for (c = 0; c < xf86_config->num_crtc; c++) {
 			if (info->tear_free)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8cedc5f..30a0f54 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -721,10 +721,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		if (drmmode_crtc->rotate.fb_id) {
 			fb_id = drmmode_crtc->rotate.fb_id;
 			x = y = 0;
-		} else if (
-#ifdef AMDGPU_PIXMAP_SHARING
-			   !pScreen->isGPU &&
-#endif
+
+		} else if (!amdgpu_is_gpu_screen(pScreen) &&
 			   (info->tear_free ||
 #if XF86_CRTC_VERSION >= 4
 			    crtc->driverIsPerformingTransform ||
-- 
2.10.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH xf86-video-amdgpu v2] Add amdgpu_is_gpu_screen helper
       [not found] ` <20161128085139.30426-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-11-28  8:56   ` Michel Dänzer
       [not found]     ` <20161128085642.30554-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2016-11-28 16:08   ` [PATCH xf86-video-amdgpu] Add radeon_is_gpu_screen helper Deucher, Alexander
  1 sibling, 1 reply; 4+ messages in thread
From: Michel Dänzer @ 2016-11-28  8:56 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

From: Michel Dänzer <michel.daenzer@amd.com>

This will hopefully decrease the chance of accidentally breaking the
build against xserver < 1.13 in the future.

(Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---

v2: radeon_is_gpu_screen -> amdgpu_is_gpu_screen in shortlog

 src/amdgpu_drv.h      |  3 +++
 src/amdgpu_kms.c      | 14 +++-----------
 src/drmmode_display.c |  6 ++----
 3 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index ebfca8c..4eb4cf4 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -149,6 +149,9 @@ typedef enum {
 
 #if XF86_CRTC_VERSION >= 5
 #define AMDGPU_PIXMAP_SHARING 1
+#define amdgpu_is_gpu_screen(screen) (screen)->isGPU
+#else
+#define amdgpu_is_gpu_screen(screen) 0
 #endif
 
 #define AMDGPU_VSYNC_TIMEOUT	20000	/* Maximum wait for VSYNC (in usecs) */
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index 18d2abb..bc48ca6 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -237,10 +237,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
 	if (dixPrivateKeyRegistered(rrPrivKey)) {
 		rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
 
-		if (
-#ifdef AMDGPU_PIXMAP_SHARING
-		    !pScreen->isGPU &&
-#endif
+		if (!amdgpu_is_gpu_screen(pScreen) &&
 		    !rrScrPriv->primaryOutput)
 		{
 			xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
@@ -277,10 +274,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
 		amdgpu_glamor_create_screen_resources(pScreen);
 
 	info->callback_event_type = -1;
-	if (
-#ifdef AMDGPU_PIXMAP_SHARING
-		!pScreen->isGPU &&
-#endif
+	if (!amdgpu_is_gpu_screen(pScreen) &&
 		(damage_ext = CheckExtension("DAMAGE"))) {
 		info->callback_event_type = damage_ext->eventBase + XDamageNotify;
 
@@ -1001,9 +995,7 @@ static void AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
 	(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
 	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
 
-#ifdef AMDGPU_PIXMAP_SHARING
-	if (!pScreen->isGPU)
-#endif
+	if (!amdgpu_is_gpu_screen(pScreen))
 	{
 		for (c = 0; c < xf86_config->num_crtc; c++) {
 			if (info->tear_free)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8cedc5f..30a0f54 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -721,10 +721,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		if (drmmode_crtc->rotate.fb_id) {
 			fb_id = drmmode_crtc->rotate.fb_id;
 			x = y = 0;
-		} else if (
-#ifdef AMDGPU_PIXMAP_SHARING
-			   !pScreen->isGPU &&
-#endif
+
+		} else if (!amdgpu_is_gpu_screen(pScreen) &&
 			   (info->tear_free ||
 #if XF86_CRTC_VERSION >= 4
 			    crtc->driverIsPerformingTransform ||
-- 
2.10.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH xf86-video-amdgpu] Add radeon_is_gpu_screen helper
       [not found] ` <20161128085139.30426-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2016-11-28  8:56   ` [PATCH xf86-video-amdgpu v2] Add amdgpu_is_gpu_screen helper Michel Dänzer
@ 2016-11-28 16:08   ` Deucher, Alexander
  1 sibling, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2016-11-28 16:08 UTC (permalink / raw)
  To: 'Michel Dänzer', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Monday, November 28, 2016 3:52 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH xf86-video-amdgpu] Add radeon_is_gpu_screen helper
> 
> From: Michel Dänzer <michel.daenzer@amd.com>
> 
> This will hopefully decrease the chance of accidentally breaking the
> build against xserver < 1.13 in the future.
> 
> (Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a)
> 
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  src/amdgpu_drv.h      |  3 +++
>  src/amdgpu_kms.c      | 14 +++-----------
>  src/drmmode_display.c |  6 ++----
>  3 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
> index ebfca8c..4eb4cf4 100644
> --- a/src/amdgpu_drv.h
> +++ b/src/amdgpu_drv.h
> @@ -149,6 +149,9 @@ typedef enum {
> 
>  #if XF86_CRTC_VERSION >= 5
>  #define AMDGPU_PIXMAP_SHARING 1
> +#define amdgpu_is_gpu_screen(screen) (screen)->isGPU
> +#else
> +#define amdgpu_is_gpu_screen(screen) 0
>  #endif
> 
>  #define AMDGPU_VSYNC_TIMEOUT	20000	/* Maximum wait for VSYNC
> (in usecs) */
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index 18d2abb..bc48ca6 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -237,10 +237,7 @@ static Bool
> AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
>  	if (dixPrivateKeyRegistered(rrPrivKey)) {
>  		rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
> 
> -		if (
> -#ifdef AMDGPU_PIXMAP_SHARING
> -		    !pScreen->isGPU &&
> -#endif
> +		if (!amdgpu_is_gpu_screen(pScreen) &&
>  		    !rrScrPriv->primaryOutput)
>  		{
>  			xf86CrtcConfigPtr xf86_config =
> XF86_CRTC_CONFIG_PTR(pScrn);
> @@ -277,10 +274,7 @@ static Bool
> AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
>  		amdgpu_glamor_create_screen_resources(pScreen);
> 
>  	info->callback_event_type = -1;
> -	if (
> -#ifdef AMDGPU_PIXMAP_SHARING
> -		!pScreen->isGPU &&
> -#endif
> +	if (!amdgpu_is_gpu_screen(pScreen) &&
>  		(damage_ext = CheckExtension("DAMAGE"))) {
>  		info->callback_event_type = damage_ext->eventBase +
> XDamageNotify;
> 
> @@ -1001,9 +995,7 @@ static void
> AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
>  	(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
>  	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
> 
> -#ifdef AMDGPU_PIXMAP_SHARING
> -	if (!pScreen->isGPU)
> -#endif
> +	if (!amdgpu_is_gpu_screen(pScreen))
>  	{
>  		for (c = 0; c < xf86_config->num_crtc; c++) {
>  			if (info->tear_free)
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 8cedc5f..30a0f54 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -721,10 +721,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc,
> DisplayModePtr mode,
>  		if (drmmode_crtc->rotate.fb_id) {
>  			fb_id = drmmode_crtc->rotate.fb_id;
>  			x = y = 0;
> -		} else if (
> -#ifdef AMDGPU_PIXMAP_SHARING
> -			   !pScreen->isGPU &&
> -#endif
> +
> +		} else if (!amdgpu_is_gpu_screen(pScreen) &&
>  			   (info->tear_free ||
>  #if XF86_CRTC_VERSION >= 4
>  			    crtc->driverIsPerformingTransform ||
> --
> 2.10.2
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH xf86-video-amdgpu v2] Add amdgpu_is_gpu_screen helper
       [not found]     ` <20161128085642.30554-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2016-11-28 16:09       ` Deucher, Alexander
  0 siblings, 0 replies; 4+ messages in thread
From: Deucher, Alexander @ 2016-11-28 16:09 UTC (permalink / raw)
  To: 'Michel Dänzer', amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces@lists.freedesktop.org] On Behalf
> Of Michel Dänzer
> Sent: Monday, November 28, 2016 3:57 AM
> To: amd-gfx@lists.freedesktop.org
> Subject: [PATCH xf86-video-amdgpu v2] Add amdgpu_is_gpu_screen helper
> 
> From: Michel Dänzer <michel.daenzer@amd.com>
> 
> This will hopefully decrease the chance of accidentally breaking the
> build against xserver < 1.13 in the future.
> 
> (Ported from radeon commit f130b10e63f7526360b41aa0918b4940f63f662a)
> 
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
> ---
> 
> v2: radeon_is_gpu_screen -> amdgpu_is_gpu_screen in shortlog

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> 
>  src/amdgpu_drv.h      |  3 +++
>  src/amdgpu_kms.c      | 14 +++-----------
>  src/drmmode_display.c |  6 ++----
>  3 files changed, 8 insertions(+), 15 deletions(-)
> 
> diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
> index ebfca8c..4eb4cf4 100644
> --- a/src/amdgpu_drv.h
> +++ b/src/amdgpu_drv.h
> @@ -149,6 +149,9 @@ typedef enum {
> 
>  #if XF86_CRTC_VERSION >= 5
>  #define AMDGPU_PIXMAP_SHARING 1
> +#define amdgpu_is_gpu_screen(screen) (screen)->isGPU
> +#else
> +#define amdgpu_is_gpu_screen(screen) 0
>  #endif
> 
>  #define AMDGPU_VSYNC_TIMEOUT	20000	/* Maximum wait for VSYNC
> (in usecs) */
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index 18d2abb..bc48ca6 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -237,10 +237,7 @@ static Bool
> AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
>  	if (dixPrivateKeyRegistered(rrPrivKey)) {
>  		rrScrPrivPtr rrScrPriv = rrGetScrPriv(pScreen);
> 
> -		if (
> -#ifdef AMDGPU_PIXMAP_SHARING
> -		    !pScreen->isGPU &&
> -#endif
> +		if (!amdgpu_is_gpu_screen(pScreen) &&
>  		    !rrScrPriv->primaryOutput)
>  		{
>  			xf86CrtcConfigPtr xf86_config =
> XF86_CRTC_CONFIG_PTR(pScrn);
> @@ -277,10 +274,7 @@ static Bool
> AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
>  		amdgpu_glamor_create_screen_resources(pScreen);
> 
>  	info->callback_event_type = -1;
> -	if (
> -#ifdef AMDGPU_PIXMAP_SHARING
> -		!pScreen->isGPU &&
> -#endif
> +	if (!amdgpu_is_gpu_screen(pScreen) &&
>  		(damage_ext = CheckExtension("DAMAGE"))) {
>  		info->callback_event_type = damage_ext->eventBase +
> XDamageNotify;
> 
> @@ -1001,9 +995,7 @@ static void
> AMDGPUBlockHandler_KMS(BLOCKHANDLER_ARGS_DECL)
>  	(*pScreen->BlockHandler) (BLOCKHANDLER_ARGS);
>  	pScreen->BlockHandler = AMDGPUBlockHandler_KMS;
> 
> -#ifdef AMDGPU_PIXMAP_SHARING
> -	if (!pScreen->isGPU)
> -#endif
> +	if (!amdgpu_is_gpu_screen(pScreen))
>  	{
>  		for (c = 0; c < xf86_config->num_crtc; c++) {
>  			if (info->tear_free)
> diff --git a/src/drmmode_display.c b/src/drmmode_display.c
> index 8cedc5f..30a0f54 100644
> --- a/src/drmmode_display.c
> +++ b/src/drmmode_display.c
> @@ -721,10 +721,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc,
> DisplayModePtr mode,
>  		if (drmmode_crtc->rotate.fb_id) {
>  			fb_id = drmmode_crtc->rotate.fb_id;
>  			x = y = 0;
> -		} else if (
> -#ifdef AMDGPU_PIXMAP_SHARING
> -			   !pScreen->isGPU &&
> -#endif
> +
> +		} else if (!amdgpu_is_gpu_screen(pScreen) &&
>  			   (info->tear_free ||
>  #if XF86_CRTC_VERSION >= 4
>  			    crtc->driverIsPerformingTransform ||
> --
> 2.10.2
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2016-11-28 16:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-28  8:51 [PATCH xf86-video-amdgpu] Add radeon_is_gpu_screen helper Michel Dänzer
     [not found] ` <20161128085139.30426-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-11-28  8:56   ` [PATCH xf86-video-amdgpu v2] Add amdgpu_is_gpu_screen helper Michel Dänzer
     [not found]     ` <20161128085642.30554-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-11-28 16:09       ` Deucher, Alexander
2016-11-28 16:08   ` [PATCH xf86-video-amdgpu] Add radeon_is_gpu_screen helper Deucher, Alexander

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.