All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu 0/3] Fixes for building against older Xorg
@ 2017-03-06  9:33 Michel Dänzer
       [not found] ` <20170306093303.32723-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2017-03-06  9:33 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

This fixes all errors down to Xorg 1.10.

One warning remains, see below. This could be silenced by casting the
return value of amdgpu_get_marketing_name to (char*), but that's ugly
and doesn't seem worth it.

../../src/amdgpu_kms.c: In function ‘AMDGPUPreInitChipType_KMS’:
../../src/amdgpu_kms.c:1174:17: warning: assignment discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  pScrn->chipset = amdgpu_get_marketing_name(pAMDGPUEnt->pDev);
                 ^

Michel Dänzer (3):
  Don't use pScrn->is_gpu in AMDGPUCreateScreenResources_KMS
  Use local implementation of RegionDuplicate for older xserver
  Only define transform_region for XF86_CRTC_VERSION >= 4

 configure.ac     |  6 ++++++
 src/amdgpu_drv.h | 19 +++++++++++++++++++
 src/amdgpu_kms.c |  6 +++++-
 3 files changed, 30 insertions(+), 1 deletion(-)

-- 
2.11.0

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

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

* [PATCH xf86-video-amdgpu 1/3] Don't use pScrn->is_gpu in AMDGPUCreateScreenResources_KMS
       [not found] ` <20170306093303.32723-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-03-06  9:33   ` Michel Dänzer
  2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 2/3] Use local implementation of RegionDuplicate for older xserver Michel Dänzer
  2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 3/3] Only define transform_region for XF86_CRTC_VERSION >= 4 Michel Dänzer
  2 siblings, 0 replies; 5+ messages in thread
From: Michel Dänzer @ 2017-03-06  9:33 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

Looks like this snuck in accidentally.

Brings us back in line with the radeon driver, and fixes the build
against older versions of xserver which didn't have the is_gpu field
yet.

Fixes: 6bab8fabb37e ("Remove info->dri2.drm_fd and info->drmmode->fd")
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/amdgpu_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index c5205e25a..bfc353096 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -248,7 +248,7 @@ static Bool AMDGPUCreateScreenResources_KMS(ScreenPtr pScreen)
 		}
 	}
 
-	if (!drmmode_set_desired_modes(pScrn, &info->drmmode, pScrn->is_gpu))
+	if (!drmmode_set_desired_modes(pScrn, &info->drmmode, FALSE))
 		return FALSE;
 
 	drmmode_uevent_init(pScrn, &info->drmmode);
-- 
2.11.0

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

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

* [PATCH xf86-video-amdgpu 2/3] Use local implementation of RegionDuplicate for older xserver
       [not found] ` <20170306093303.32723-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 1/3] Don't use pScrn->is_gpu in AMDGPUCreateScreenResources_KMS Michel Dänzer
@ 2017-03-06  9:33   ` Michel Dänzer
  2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 3/3] Only define transform_region for XF86_CRTC_VERSION >= 4 Michel Dänzer
  2 siblings, 0 replies; 5+ messages in thread
From: Michel Dänzer @ 2017-03-06  9:33 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

It was only added in xserver 1.15. Fixes build against older xserver.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
(Ported from radeon commit 80cc892ee1ce54fad3cb7dd11bd9df18c359136f)

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 configure.ac     |  6 ++++++
 src/amdgpu_drv.h | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/configure.ac b/configure.ac
index 11dc28544..00249a599 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,6 +152,12 @@ else
 fi
 AM_CONDITIONAL(GLAMOR, test x$GLAMOR != xno)
 
+AC_CHECK_DECL(RegionDuplicate,
+	      [AC_DEFINE(HAVE_REGIONDUPLICATE, 1,
+	      [Have RegionDuplicate API])], [],
+	      [#include <xorg-server.h>
+	       #include <regionstr.h>])
+
 AC_CHECK_DECL(fbGlyphs,
 	      [AC_DEFINE(HAVE_FBGLYPHS, 1, [Have fbGlyphs API])], [],
 	      [#include <X11/Xmd.h>
diff --git a/src/amdgpu_drv.h b/src/amdgpu_drv.h
index ae5b6f94c..0700daecb 100644
--- a/src/amdgpu_drv.h
+++ b/src/amdgpu_drv.h
@@ -89,6 +89,25 @@
 
 struct _SyncFence;
 
+#ifndef HAVE_REGIONDUPLICATE
+
+static inline RegionPtr
+RegionDuplicate(RegionPtr pOld)
+{
+	RegionPtr pNew;
+
+	pNew = RegionCreate(&pOld->extents, 0);
+	if (!pNew)
+		return NULL;
+	if (!RegionCopy(pNew, pOld)) {
+		RegionDestroy(pNew);
+		return NULL;
+	}
+	return pNew;
+}
+
+#endif
+
 #ifndef MAX
 #define MAX(a,b) ((a)>(b)?(a):(b))
 #endif
-- 
2.11.0

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

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

* [PATCH xf86-video-amdgpu 3/3] Only define transform_region for XF86_CRTC_VERSION >= 4
       [not found] ` <20170306093303.32723-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 1/3] Don't use pScrn->is_gpu in AMDGPUCreateScreenResources_KMS Michel Dänzer
  2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 2/3] Use local implementation of RegionDuplicate for older xserver Michel Dänzer
@ 2017-03-06  9:33   ` Michel Dänzer
       [not found]     ` <20170306093303.32723-4-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2 siblings, 1 reply; 5+ messages in thread
From: Michel Dänzer @ 2017-03-06  9:33 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

Not used with older versions of Xorg. Fixes warning in that case:

../../src/amdgpu_kms.c:328:1: warning: ‘transform_region’ defined but not used [-Wunused-function]
 transform_region(RegionPtr region, struct pict_f_transform *transform,
 ^~~~~~~~~~~~~~~~

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/amdgpu_kms.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index bfc353096..d48ad480a 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -324,6 +324,8 @@ amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents)
 	return (extents->x1 < extents->x2 && extents->y1 < extents->y2);
 }
 
+#if XF86_CRTC_VERSION >= 4
+
 static RegionPtr
 transform_region(RegionPtr region, struct pict_f_transform *transform,
 		 int w, int h)
@@ -362,6 +364,8 @@ transform_region(RegionPtr region, struct pict_f_transform *transform,
 	return transformed;
 }
 
+#endif
+
 static void
 amdgpu_sync_scanout_pixmaps(xf86CrtcPtr xf86_crtc, RegionPtr new_region,
 							int scanout_id)
-- 
2.11.0

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

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

* Re: [PATCH xf86-video-amdgpu 3/3] Only define transform_region for XF86_CRTC_VERSION >= 4
       [not found]     ` <20170306093303.32723-4-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2017-03-06 15:16       ` Alex Deucher
  0 siblings, 0 replies; 5+ messages in thread
From: Alex Deucher @ 2017-03-06 15:16 UTC (permalink / raw)
  To: Michel Dänzer; +Cc: amd-gfx list

On Mon, Mar 6, 2017 at 4:33 AM, Michel Dänzer <michel@daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer@amd.com>
>
> Not used with older versions of Xorg. Fixes warning in that case:
>
> ../../src/amdgpu_kms.c:328:1: warning: ‘transform_region’ defined but not used [-Wunused-function]
>  transform_region(RegionPtr region, struct pict_f_transform *transform,
>  ^~~~~~~~~~~~~~~~
>
> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

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

> ---
>  src/amdgpu_kms.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
> index bfc353096..d48ad480a 100644
> --- a/src/amdgpu_kms.c
> +++ b/src/amdgpu_kms.c
> @@ -324,6 +324,8 @@ amdgpu_scanout_extents_intersect(xf86CrtcPtr xf86_crtc, BoxPtr extents)
>         return (extents->x1 < extents->x2 && extents->y1 < extents->y2);
>  }
>
> +#if XF86_CRTC_VERSION >= 4
> +
>  static RegionPtr
>  transform_region(RegionPtr region, struct pict_f_transform *transform,
>                  int w, int h)
> @@ -362,6 +364,8 @@ transform_region(RegionPtr region, struct pict_f_transform *transform,
>         return transformed;
>  }
>
> +#endif
> +
>  static void
>  amdgpu_sync_scanout_pixmaps(xf86CrtcPtr xf86_crtc, RegionPtr new_region,
>                                                         int scanout_id)
> --
> 2.11.0
>
> _______________________________________________
> 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] 5+ messages in thread

end of thread, other threads:[~2017-03-06 15:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-06  9:33 [PATCH xf86-video-amdgpu 0/3] Fixes for building against older Xorg Michel Dänzer
     [not found] ` <20170306093303.32723-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 1/3] Don't use pScrn->is_gpu in AMDGPUCreateScreenResources_KMS Michel Dänzer
2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 2/3] Use local implementation of RegionDuplicate for older xserver Michel Dänzer
2017-03-06  9:33   ` [PATCH xf86-video-amdgpu 3/3] Only define transform_region for XF86_CRTC_VERSION >= 4 Michel Dänzer
     [not found]     ` <20170306093303.32723-4-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2017-03-06 15:16       ` Alex Deucher

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.