All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time
@ 2018-07-09  7:26 Michel Dänzer
       [not found] ` <20180709072652.9727-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2018-07-09  7:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Keith Packard

From: Keith Packard <keithp@keithp.com>

Save any value of the kernel non-desktop property in the xf86Output
structure to avoid non-desktop outputs in the default configuration.

[Also bump randrproto requirement to a version that defines
RR_PROPERTY_NON_DESKTOP - ajax]

Signed-off-by: Keith Packard <keithp@keithp.com>
(Ported from xserver commit b91c787c4cd2d20685db69426c539938c556128a)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 configure.ac          |  2 +-
 src/drmmode_display.c | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 2593f52ca..a475f3713 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,7 @@ AC_ARG_WITH(xorg-module-dir,
             [moduledir="$libdir/xorg/modules"])
 
 # Store the list of server defined optional extensions in REQUIRED_MODULES
-XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
+XORG_DRIVER_CHECK_EXT(RANDR, [randrproto >= 1.6.0])
 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
 XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9364a885a..ca8a61785 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2595,6 +2595,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 	drmModeEncoderPtr *kencoders = NULL;
 	drmmode_output_private_ptr drmmode_output;
 	drmModePropertyBlobPtr path_blob = NULL;
+#if XF86_CRTC_VERSION >= 8
+	Bool nonDesktop = FALSE;
+#endif
 	char name[32];
 	int i;
 	const char *s;
@@ -2607,6 +2610,13 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 
 	path_blob = koutput_get_prop_blob(pAMDGPUEnt->fd, koutput, "PATH");
 
+#if XF86_CRTC_VERSION >= 8
+	i = koutput_get_prop_idx(pAMDGPUEnt->fd, koutput, DRM_MODE_PROP_RANGE,
+				 RR_PROPERTY_NON_DESKTOP);
+	if (i >= 0)
+        	nonDesktop = koutput->prop_values[i] != 0;
+#endif
+
 	kencoders = calloc(sizeof(drmModeEncoderPtr), koutput->count_encoders);
 	if (!kencoders) {
 		goto out_free_encoders;
@@ -2638,6 +2648,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 			drmmode_output = output->driver_private;
 			drmmode_output->output_id = mode_res->connectors[num];
 			drmmode_output->mode_output = koutput;
+#if XF86_CRTC_VERSION >= 8
+			output->non_desktop = nonDesktop;
+#endif
 			for (i = 0; i < koutput->count_encoders; i++) {
 				drmModeFreeEncoder(kencoders[i]);
 			}
@@ -2681,6 +2694,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 	output->interlaceAllowed = TRUE;
 	output->doubleScanAllowed = TRUE;
 	output->driver_private = drmmode_output;
+#if XF86_CRTC_VERSION >= 8
+	output->non_desktop = nonDesktop;
+#endif
 
 	output->possible_crtcs = 0xffffffff;
 	for (i = 0; i < koutput->count_encoders; i++) {
-- 
2.18.0

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

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

* [PATCH xf86-video-amdgpu 2/3] modesetting: Create CONNECTOR_ID properties for outputs [v2]
       [not found] ` <20180709072652.9727-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-09  7:26   ` Michel Dänzer
  2018-07-09  7:26   ` [PATCH xf86-video-amdgpu 3/3] Add RandR leases support Michel Dänzer
  2018-07-09 16:14   ` [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time Keith Packard
  2 siblings, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2018-07-09  7:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Keith Packard

From: Keith Packard <keithp@keithp.com>

This lets a DRM client map between X outputs and kernel connectors.

v2:
	Change CONNECTOR_ID to enum -- Adam Jackson <ajax@nwnk.net>

Signed-off-by: Keith Packard <keithp@keithp.com>
(Ported from xserver commit 023d4aba8d45e9e3630b944ecfb650c081799b96)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 src/drmmode_display.c | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index ca8a61785..031d826af 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2192,6 +2192,28 @@ static void drmmode_output_create_resources(xf86OutputPtr output)
 	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(output->scrn);
 	drmModePropertyPtr drmmode_prop, tearfree_prop;
 	int i, j, err;
+	Atom name;
+
+	/* Create CONNECTOR_ID property */
+	name = MakeAtom("CONNECTOR_ID", 12, TRUE);
+	if (name != BAD_RESOURCE) {
+		INT32 value = mode_output->connector_id;
+
+		err = RRConfigureOutputProperty(output->randr_output, name,
+						FALSE, FALSE, TRUE, 1, &value);
+		if (err != Success) {
+			xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+				   "RRConfigureOutputProperty error, %d\n", err);
+		}
+
+		err = RRChangeOutputProperty(output->randr_output, name,
+					     XA_INTEGER, 32, PropModeReplace, 1,
+					     &value, FALSE, FALSE);
+		if (err != Success) {
+			xf86DrvMsg(output->scrn->scrnIndex, X_ERROR,
+				   "RRChangeOutputProperty error, %d\n", err);
+		}
+	}
 
 	drmmode_output->props =
 		calloc(mode_output->count_props + 1, sizeof(drmmode_prop_rec));
-- 
2.18.0

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

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

* [PATCH xf86-video-amdgpu 3/3] Add RandR leases support
       [not found] ` <20180709072652.9727-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-07-09  7:26   ` [PATCH xf86-video-amdgpu 2/3] modesetting: Create CONNECTOR_ID properties for outputs [v2] Michel Dänzer
@ 2018-07-09  7:26   ` Michel Dänzer
  2018-07-09 16:14   ` [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time Keith Packard
  2 siblings, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2018-07-09  7:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Keith Packard

From: Keith Packard <keithp@keithp.com>

Signed-off-by: Keith Packard <keithp@keithp.com>
(Ported from xserver commit e4e3447603b5fd3a38a92c3f972396d1f81168ad)
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 configure.ac          |   2 +-
 src/amdgpu_kms.c      |   1 +
 src/drmmode_display.c | 159 +++++++++++++++++++++++++++++++++++++++++-
 src/drmmode_display.h |   6 ++
 4 files changed, 166 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index a475f3713..f4633e370 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,7 +70,7 @@ XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Checks for libraries.
-PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.78])
+PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.89])
 PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.76])
 PKG_CHECK_MODULES(GBM, [gbm])
 
diff --git a/src/amdgpu_kms.c b/src/amdgpu_kms.c
index bedd02037..c357ab6b7 100644
--- a/src/amdgpu_kms.c
+++ b/src/amdgpu_kms.c
@@ -1703,6 +1703,7 @@ static Bool AMDGPUCloseScreen_KMS(ScreenPtr pScreen)
 	/* Clear mask of assigned crtc's in this generation */
 	pAMDGPUEnt->assigned_crtcs = 0;
 
+	drmmode_terminate_leases(pScrn);
 	drmmode_uevent_fini(pScrn, &info->drmmode);
 	amdgpu_drm_queue_close(pScrn);
 
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 031d826af..fee6fedfb 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2936,8 +2936,159 @@ fail:
 	return FALSE;
 }
 
+static void
+drmmode_validate_leases(ScrnInfoPtr scrn)
+{
+#ifdef XF86_LEASE_VERSION
+	ScreenPtr screen = scrn->pScreen;
+	rrScrPrivPtr scr_priv = rrGetScrPriv(screen);
+	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
+	drmModeLesseeListPtr lessees;
+	RRLeasePtr lease, next;
+	int l;
+
+	/* We can't talk to the kernel about leases when VT switched */
+	if (!scrn->vtSema)
+		return;
+
+	lessees = drmModeListLessees(pAMDGPUEnt->fd);
+	if (!lessees)
+		return;
+
+	xorg_list_for_each_entry_safe(lease, next, &scr_priv->leases, list) {
+		drmmode_lease_private_ptr lease_private = lease->devPrivate;
+
+		for (l = 0; l < lessees->count; l++) {
+			if (lessees->lessees[l] == lease_private->lessee_id)
+				break;
+		}
+
+		/* check to see if the lease has gone away */
+		if (l == lessees->count) {
+			free(lease_private);
+			lease->devPrivate = NULL;
+			xf86CrtcLeaseTerminated(lease);
+		}
+	}
+
+	free(lessees);
+#endif
+}
+
+#ifdef XF86_LEASE_VERSION
+
+static int
+drmmode_create_lease(RRLeasePtr lease, int *fd)
+{
+	ScreenPtr screen = lease->screen;
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
+	drmmode_lease_private_ptr lease_private;
+	int noutput = lease->numOutputs;
+	int ncrtc = lease->numCrtcs;
+	uint32_t *objects;
+	size_t nobjects;
+	int lease_fd;
+	int c, o;
+	int i;
+
+	nobjects = ncrtc + noutput;
+	if (nobjects == 0 || nobjects > (SIZE_MAX / 4) ||
+	    ncrtc > (SIZE_MAX - noutput))
+		return BadValue;
+
+	lease_private = calloc(1, sizeof (drmmode_lease_private_rec));
+	if (!lease_private)
+		return BadAlloc;
+
+	objects = malloc(nobjects * 4);
+	if (!objects) {
+		free(lease_private);
+		return BadAlloc;
+	}
+
+	i = 0;
+
+	/* Add CRTC ids */
+	for (c = 0; c < ncrtc; c++) {
+		xf86CrtcPtr crtc = lease->crtcs[c]->devPrivate;
+		drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+
+		objects[i++] = drmmode_crtc->mode_crtc->crtc_id;
+	}
+
+	/* Add connector ids */
+	for (o = 0; o < noutput; o++) {
+		xf86OutputPtr   output = lease->outputs[o]->devPrivate;
+		drmmode_output_private_ptr drmmode_output = output->driver_private;
+
+		objects[i++] = drmmode_output->mode_output->connector_id;
+	}
+
+	/* call kernel to create lease */
+	assert (i == nobjects);
+
+	lease_fd = drmModeCreateLease(pAMDGPUEnt->fd, objects, nobjects, 0,
+				      &lease_private->lessee_id);
+
+	free(objects);
+
+	if (lease_fd < 0) {
+		free(lease_private);
+		return BadMatch;
+	}
+
+	lease->devPrivate = lease_private;
+
+	xf86CrtcLeaseStarted(lease);
+
+	*fd = lease_fd;
+	return Success;
+}
+
+static void
+drmmode_terminate_lease(RRLeasePtr lease)
+{
+	drmmode_lease_private_ptr lease_private = lease->devPrivate;
+	ScreenPtr screen = lease->screen;
+	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(scrn);
+
+	if (drmModeRevokeLease(pAMDGPUEnt->fd, lease_private->lessee_id) == 0) {
+		free(lease_private);
+		lease->devPrivate = NULL;
+		xf86CrtcLeaseTerminated(lease);
+	}
+}
+
+#endif // XF86_LEASE_VERSION
+
+void
+drmmode_terminate_leases(ScrnInfoPtr pScrn)
+{
+#ifdef XF86_LEASE_VERSION
+	ScreenPtr screen = xf86ScrnToScreen(pScrn);
+	AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(pScrn);
+	rrScrPrivPtr scr_priv = rrGetScrPriv(screen);
+	RRLeasePtr lease, next;
+
+	xorg_list_for_each_entry_safe(lease, next, &scr_priv->leases, list) {
+		drmmode_lease_private_ptr lease_private = lease->devPrivate;
+		drmModeRevokeLease(pAMDGPUEnt->fd, lease_private->lessee_id);
+		free(lease_private);
+		lease->devPrivate = NULL;
+		RRLeaseTerminated(lease);
+		RRLeaseFree(lease);
+	}
+#endif
+}
+
 static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
-	drmmode_xf86crtc_resize
+	.resize = drmmode_xf86crtc_resize,
+#ifdef XF86_LEASE_VERSION
+	.create_lease = drmmode_create_lease,
+	.terminate_lease = drmmode_terminate_lease
+#endif
 };
 
 static void
@@ -3476,6 +3627,9 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
 		return FALSE;
 	}
 
+	/* Validate leases on VT re-entry */
+	drmmode_validate_leases(pScrn);
+
 	return TRUE;
 }
 
@@ -3642,6 +3796,9 @@ restart_destroy:
 			changed = TRUE;
 	}
 
+	/* Check to see if a lessee has disappeared */
+	drmmode_validate_leases(scrn);
+
 	if (changed && dixPrivateKeyRegistered(rrPrivKey)) {
 #if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,14,99,2,0)
 		RRSetChanged(xf86ScrnToScreen(scrn));
diff --git a/src/drmmode_display.h b/src/drmmode_display.h
index 0f0227c71..0646752c2 100644
--- a/src/drmmode_display.h
+++ b/src/drmmode_display.h
@@ -157,6 +157,10 @@ typedef struct {
 	int tear_free;
 } drmmode_output_private_rec, *drmmode_output_private_ptr;
 
+typedef struct {
+	uint32_t lessee_id;
+} drmmode_lease_private_rec, *drmmode_lease_private_ptr;
+
 
 enum drmmode_flip_sync {
     FLIP_VSYNC,
@@ -241,6 +245,8 @@ PixmapPtr drmmode_crtc_scanout_create(xf86CrtcPtr crtc,
 extern void drmmode_uevent_init(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 extern void drmmode_uevent_fini(ScrnInfoPtr scrn, drmmode_ptr drmmode);
 
+extern void drmmode_terminate_leases(ScrnInfoPtr scrn);
+
 Bool drmmode_set_mode(xf86CrtcPtr crtc, struct drmmode_fb *fb,
 		      DisplayModePtr mode, int x, int y);
 
-- 
2.18.0

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

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

* Re: [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time
       [not found] ` <20180709072652.9727-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-07-09  7:26   ` [PATCH xf86-video-amdgpu 2/3] modesetting: Create CONNECTOR_ID properties for outputs [v2] Michel Dänzer
  2018-07-09  7:26   ` [PATCH xf86-video-amdgpu 3/3] Add RandR leases support Michel Dänzer
@ 2018-07-09 16:14   ` Keith Packard
       [not found]     ` <87o9fg4c9i.fsf-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
  2 siblings, 1 reply; 9+ messages in thread
From: Keith Packard @ 2018-07-09 16:14 UTC (permalink / raw)
  To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 935 bytes --]

Michel Dänzer <michel-otUistvHUpPR7s880joybQ@public.gmane.org> writes:

> From: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
>
> Save any value of the kernel non-desktop property in the xf86Output
> structure to avoid non-desktop outputs in the default configuration.
>
> [Also bump randrproto requirement to a version that defines
> RR_PROPERTY_NON_DESKTOP - ajax]
>
> Signed-off-by: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
> (Ported from xserver commit b91c787c4cd2d20685db69426c539938c556128a)
> Signed-off-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>

Thanks for porting this and making it compile on older server versions;
I notice that you switched from xallocarray to calloc -- seems fine to
me as it avoids some extra configure.ac goop.

For the series:
Reviewed-by: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>

-- 
-keith

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time
       [not found]     ` <87o9fg4c9i.fsf-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
@ 2018-07-09 16:20       ` Michel Dänzer
       [not found]         ` <af4f8c39-0936-dc48-ad67-96b108463619-otUistvHUpPR7s880joybQ@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2018-07-09 16:20 UTC (permalink / raw)
  To: Keith Packard; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1.1: Type: text/plain, Size: 1276 bytes --]

On 2018-07-09 06:14 PM, Keith Packard wrote:
> Michel Dänzer <michel-otUistvHUpPR7s880joybQ@public.gmane.org> writes:
> 
>> From: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
>>
>> Save any value of the kernel non-desktop property in the xf86Output
>> structure to avoid non-desktop outputs in the default configuration.
>>
>> [Also bump randrproto requirement to a version that defines
>> RR_PROPERTY_NON_DESKTOP - ajax]
>>
>> Signed-off-by: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
>> (Ported from xserver commit b91c787c4cd2d20685db69426c539938c556128a)
>> Signed-off-by: Michel Dänzer <michel.daenzer-5C7GfCeVMHo@public.gmane.org>
> 
> Thanks for porting this and making it compile on older server versions;
> I notice that you switched from xallocarray to calloc -- seems fine to
> me as it avoids some extra configure.ac goop.

Yep, didn't see the point of that, as ncrtc + noutput needs to be
explicitly checked for overflow anyway.


> For the series:
> Reviewed-by: Keith Packard <keithp-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>

Thanks!


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

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

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

* Re: [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time
       [not found]         ` <af4f8c39-0936-dc48-ad67-96b108463619-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-13  2:26           ` Yu, Qiang
       [not found]             ` <CY4PR1201MB0117859F55CBFAFE76E560EF8F580-1iTaO6aE1DAP/tBwSbHU42rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Yu, Qiang @ 2018-07-13  2:26 UTC (permalink / raw)
  To: Michel Dänzer, Keith Packard
  Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi Michel,

Could randrproto >= 1.6.0 also be optional? randrproto 1.6 is pretty new so
most old xserver doesn't compile with it. When compile latest ddx with
various OS we support, it will fail.

Maybe we can define RR_PROPERTY_NON_DESKTOP in ddx if not yet.

Regards,
Qiang

________________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net>
Sent: Tuesday, July 10, 2018 12:20:46 AM
To: Keith Packard
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time

On 2018-07-09 06:14 PM, Keith Packard wrote:
> Michel Dänzer <michel@daenzer.net> writes:
>
>> From: Keith Packard <keithp@keithp.com>
>>
>> Save any value of the kernel non-desktop property in the xf86Output
>> structure to avoid non-desktop outputs in the default configuration.
>>
>> [Also bump randrproto requirement to a version that defines
>> RR_PROPERTY_NON_DESKTOP - ajax]
>>
>> Signed-off-by: Keith Packard <keithp@keithp.com>
>> (Ported from xserver commit b91c787c4cd2d20685db69426c539938c556128a)
>> Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
>
> Thanks for porting this and making it compile on older server versions;
> I notice that you switched from xallocarray to calloc -- seems fine to
> me as it avoids some extra configure.ac goop.

Yep, didn't see the point of that, as ncrtc + noutput needs to be
explicitly checked for overflow anyway.


> For the series:
> Reviewed-by: Keith Packard <keithp@keithp.com>

Thanks!


--
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer

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

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

* [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name
       [not found]             ` <CY4PR1201MB0117859F55CBFAFE76E560EF8F580-1iTaO6aE1DAP/tBwSbHU42rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
@ 2018-07-13  8:41               ` Michel Dänzer
       [not found]                 ` <20180713084151.6200-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
  2018-07-13  8:44               ` [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time Michel Dänzer
  1 sibling, 1 reply; 9+ messages in thread
From: Michel Dänzer @ 2018-07-13  8:41 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

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

It's a bit silly to require current randrproto just for this definition,
which can't really change anyway.

Suggested-by: Qiang Yu <qiang.yu@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 configure.ac          | 2 +-
 src/drmmode_display.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f4633e370..1ab5a7ae2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,7 @@ AC_ARG_WITH(xorg-module-dir,
             [moduledir="$libdir/xorg/modules"])
 
 # Store the list of server defined optional extensions in REQUIRED_MODULES
-XORG_DRIVER_CHECK_EXT(RANDR, [randrproto >= 1.6.0])
+XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
 XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f6cafccdc..ccf333662 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2634,7 +2634,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r
 
 #if XF86_CRTC_VERSION >= 8
 	i = koutput_get_prop_idx(pAMDGPUEnt->fd, koutput, DRM_MODE_PROP_RANGE,
-				 RR_PROPERTY_NON_DESKTOP);
+				 "non-desktop");
 	if (i >= 0)
         	nonDesktop = koutput->prop_values[i] != 0;
 #endif
-- 
2.18.0

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

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

* Re: [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time
       [not found]             ` <CY4PR1201MB0117859F55CBFAFE76E560EF8F580-1iTaO6aE1DAP/tBwSbHU42rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
  2018-07-13  8:41               ` [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name Michel Dänzer
@ 2018-07-13  8:44               ` Michel Dänzer
  1 sibling, 0 replies; 9+ messages in thread
From: Michel Dänzer @ 2018-07-13  8:44 UTC (permalink / raw)
  To: Yu, Qiang, Keith Packard; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On 2018-07-13 04:26 AM, Yu, Qiang wrote:
> Hi Michel,
> 
> Could randrproto >= 1.6.0 also be optional? randrproto 1.6 is pretty new so
> most old xserver doesn't compile with it. When compile latest ddx with
> various OS we support, it will fail.
> 
> Maybe we can define RR_PROPERTY_NON_DESKTOP in ddx if not yet.

Yeah, please review https://patchwork.freedesktop.org/patch/238250/ .


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name
       [not found]                 ` <20180713084151.6200-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
@ 2018-07-16  2:16                   ` Yu, Qiang
  0 siblings, 0 replies; 9+ messages in thread
From: Yu, Qiang @ 2018-07-16  2:16 UTC (permalink / raw)
  To: Michel Dänzer, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Thanks, looks good for me.
Reviewed-by: Qiang Yu <Qiang.Yu@amd.com>

Regards,
Qiang

________________________________________
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net>
Sent: Friday, July 13, 2018 4:41:51 PM
To: amd-gfx@lists.freedesktop.org
Subject: [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name

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

It's a bit silly to require current randrproto just for this definition,
which can't really change anyway.

Suggested-by: Qiang Yu <qiang.yu@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
---
 configure.ac          | 2 +-
 src/drmmode_display.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index f4633e370..1ab5a7ae2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -64,7 +64,7 @@ AC_ARG_WITH(xorg-module-dir,
             [moduledir="$libdir/xorg/modules"])

 # Store the list of server defined optional extensions in REQUIRED_MODULES
-XORG_DRIVER_CHECK_EXT(RANDR, [randrproto >= 1.6.0])
+XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
 XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index f6cafccdc..ccf333662 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2634,7 +2634,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r

 #if XF86_CRTC_VERSION >= 8
        i = koutput_get_prop_idx(pAMDGPUEnt->fd, koutput, DRM_MODE_PROP_RANGE,
-                                RR_PROPERTY_NON_DESKTOP);
+                                "non-desktop");
        if (i >= 0)
                nonDesktop = koutput->prop_values[i] != 0;
 #endif
--
2.18.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 related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-07-16  2:16 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-09  7:26 [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time Michel Dänzer
     [not found] ` <20180709072652.9727-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-09  7:26   ` [PATCH xf86-video-amdgpu 2/3] modesetting: Create CONNECTOR_ID properties for outputs [v2] Michel Dänzer
2018-07-09  7:26   ` [PATCH xf86-video-amdgpu 3/3] Add RandR leases support Michel Dänzer
2018-07-09 16:14   ` [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time Keith Packard
     [not found]     ` <87o9fg4c9i.fsf-aN4HjG94KOLQT0dZR+AlfA@public.gmane.org>
2018-07-09 16:20       ` Michel Dänzer
     [not found]         ` <af4f8c39-0936-dc48-ad67-96b108463619-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-13  2:26           ` Yu, Qiang
     [not found]             ` <CY4PR1201MB0117859F55CBFAFE76E560EF8F580-1iTaO6aE1DAP/tBwSbHU42rFom/aUZj6nBOFsp37pqbUKgpGm//BTAC/G2K4zDHf@public.gmane.org>
2018-07-13  8:41               ` [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name Michel Dänzer
     [not found]                 ` <20180713084151.6200-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-07-16  2:16                   ` Yu, Qiang
2018-07-13  8:44               ` [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time Michel Dänzer

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.