modesetting: Record non-desktop kernel property at PreInit time
PATCH 1/3 modesetting: Record non-desktop kernel property at PreInit time
From: Keith Packard <[email protected]>
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]
(Ported from xserver commit b91c787c4cd2d20685db69426c539938c556128a)
--- configure.ac | 2 +- src/drmmode_display.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-)
configure.ac +1 -1
@@ -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)
src/drmmode_display.c +16 -0
@@ -2595,6 +2595,9 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_rdrmModeEncoderPtr *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++) {
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/3 modesetting: Create CONNECTOR_ID properties for outputs [v2]
In reply to a message not in the archiveFrom: Keith Packard <[email protected]>
This lets a DRM client map between X outputs and kernel connectors.
v2:
Change CONNECTOR_ID to enum -- Adam Jackson <[email protected]>
(Ported from xserver commit 023d4aba8d45e9e3630b944ecfb650c081799b96)
--- src/drmmode_display.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+)
src/drmmode_display.c +22 -0
@@ -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));
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/3 Add RandR leases support
In reply to a message not in the archiveFrom: Keith Packard <[email protected]>
(Ported from xserver commit e4e3447603b5fd3a38a92c3f972396d1f81168ad)
--- 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(-)
configure.ac +1 -1
@@ -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])
src/amdgpu_kms.c +1 -0
@@ -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);
src/drmmode_display.c +158 -1
178 lines not on this page · raw message
src/drmmode_display.h +6 -0
@@ -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);
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Keith Packard
Reviewed-byQuoted 11 lines · Michel Dänzer
From: Keith Packard <[email protected]>
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 <[email protected]>(Ported from xserver commit
b91c787c4cd2d20685db69426c539938c556128a)Signed-off-by Michel Dänzer <[email protected]>
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:
Signature · 1 line
-keith
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 10 lines · Keith Packard
Quoted 8 lines · Michel Dänzer
From: Keith Packard <[email protected]>
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]
Quoted 7 lines
Quoted 3 lines
Signed-off-by Keith Packard <[email protected]>(Ported from xserver commit
b91c787c4cd2d20685db69426c539938c556128a)Signed-off-by Michel Dänzer <[email protected]>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.
Quoted 2 lines
For the series:
Reviewed-by Keith Packard <[email protected]>
Thanks!
Signature · 2 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
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 <[email protected]> on behalf of Michel Dänzer <[email protected]>
Sent: Tuesday, July 10, 2018 12:20:46 AM
To: Keith Packard
Cc: [email protected]
Subject: Re: [PATCH xf86-video-amdgpu 1/3] modesetting: Record non-desktop kernel property at PreInit time
Quoted 10 lines · Keith Packard
Quoted 8 lines · Michel Dänzer
From: Keith Packard <[email protected]>
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]
Quoted 7 lines
Quoted 3 lines
Signed-off-by Keith Packard <[email protected]>(Ported from xserver commit
b91c787c4cd2d20685db69426c539938c556128a)Signed-off-by Michel Dänzer <[email protected]>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.
Quoted 2 lines
For the series:
Reviewed-by Keith Packard <[email protected]>
Thanks!
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Mesa and X developer
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 1/1 Hardcode "non-desktop" RandR property name
In reply to a message not in the archiveFrom: Michel Dänzer <[email protected]>
It's a bit silly to require current randrproto just for this definition, which can't really change anyway.
--- configure.ac | 2 +- src/drmmode_display.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
configure.ac +1 -1
@@ -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)
src/drmmode_display.c +1 -1
@@ -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
Signature · 6 lines
2.18.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 7 lines · Qiang
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_DESKTOPin ddx if not yet.
Yeah, please review https://patchwork.freedesktop.org/patch/238250/ .
Signature · 6 lines
Earthling Michel Dänzer | http://www.amd.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Yu, Qiang
Reviewed-by Qiang YuRe: [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name
In reply to a message not in the archiveThanks, looks good for me.
Regards,
Qiang
________________________________________
From: amd-gfx <[email protected]> on behalf of Michel Dänzer <[email protected]>
Sent: Friday, July 13, 2018 4:41:51 PM
To: [email protected]
Subject: [PATCH xf86-video-amdgpu] Hardcode "non-desktop" RandR property name
From: Michel Dänzer <[email protected]>
It's a bit silly to require current randrproto just for this definition, which can't really change anyway.
--- configure.ac | 2 +- src/drmmode_display.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
configure.ac +1 -1
@@ -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)
src/drmmode_display.c +1 -1
@@ -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
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx