Re: [PATCH 4.19 098/118] drm/lease: Send a distinct uevent

2018-12-11 Thread Keith Packard
Greg Kroah-Hartman writes: > 4.19-stable review patch. If anyone has any objections, please let me > know. Acked-by: Keith Packard -- -keith signature.asc Description: PGP signature

Re: [PATCH] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-07 Thread Keith Packard
Jason Ekstrand writes: > Yeah, I suppose an application could ask for 10k frames in the future or > something ridiculous like that. For sync_file, people strongly want a > finite time guarantee for security/deadlock reasons. I don't know how > happy they would be with a

Re: [PATCH] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-07 Thread Keith Packard
Jason Ekstrand writes: > Yeah, I suppose an application could ask for 10k frames in the future or > something ridiculous like that. For sync_file, people strongly want a > finite time guarantee for security/deadlock reasons. I don't know how > happy they would be with a finite time of 10

Re: [PATCH] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-06 Thread Keith Packard
Jason Ekstrand writes: > Is the given sequence number guaranteed to be hit in finite time? Certainly, it's a finite value... However, realistically, it's just like all of the other vblank interfaces where you can specify a crazy sequence and block for a very long time.

Re: [PATCH] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-06 Thread Keith Packard
Jason Ekstrand writes: > Is the given sequence number guaranteed to be hit in finite time? Certainly, it's a finite value... However, realistically, it's just like all of the other vblank interfaces where you can specify a crazy sequence and block for a very long time. So, no different from

[PATCH 0/1] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-06 Thread Keith Packard
(This is an RFC on whether this pair of ioctls seems reasonable. The code compiles, but I haven't tested it as I'm away from home this weekend.) I'm rewriting my implementation of the Vulkan EXT_display_control extension, which provides a way to signal a Vulkan fence at vblank time. I had

[PATCH] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-06 Thread Keith Packard
-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_file.c | 5 + drivers/gpu/drm/drm_internal.h | 4 + drivers/gpu/drm/drm_ioctl.c| 2 + drivers/gpu/drm/drm_syncobj.c | 13 ++- drivers/gpu/drm/drm_vblank.c | 212 + inclu

[PATCH 0/1] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-06 Thread Keith Packard
(This is an RFC on whether this pair of ioctls seems reasonable. The code compiles, but I haven't tested it as I'm away from home this weekend.) I'm rewriting my implementation of the Vulkan EXT_display_control extension, which provides a way to signal a Vulkan fence at vblank time. I had

[PATCH] drm: Add crtc_queue_syncobj and crtc_get_syncobj ioctls

2018-04-06 Thread Keith Packard
-by: Keith Packard --- drivers/gpu/drm/drm_file.c | 5 + drivers/gpu/drm/drm_internal.h | 4 + drivers/gpu/drm/drm_ioctl.c| 2 + drivers/gpu/drm/drm_syncobj.c | 13 ++- drivers/gpu/drm/drm_vblank.c | 212 + include/drm/drm_file.h

Re: [PATCH] USB: chaoskey: Use kasprintf() over strcpy()/strcat()

2018-02-16 Thread Keith Packard
Kees Cook <keesc...@chromium.org> writes: > Instead of kmalloc() with manually calculated values followed by > multiple strcpy()/strcat() calls, just fold it all into a single > kasprintf() call. > > Signed-off-by: Kees Cook <keesc...@chromium.org> Reviewed-by: Keith

Re: [PATCH] USB: chaoskey: Use kasprintf() over strcpy()/strcat()

2018-02-16 Thread Keith Packard
Kees Cook writes: > Instead of kmalloc() with manually calculated values followed by > multiple strcpy()/strcat() calls, just fold it all into a single > kasprintf() call. > > Signed-off-by: Kees Cook Reviewed-by: Keith Packard -- -keith signature.asc Description: PGP signature

Re: [PATCH] hwrng: Explicitly drop current_rng when unregistering rng device

2018-02-04 Thread Keith Packard
Tom Lendacky writes: > A similar fix was already in the cryptodev tree and I thought was part of > a recent pull request. Yup, just saw it on master. I've checked and it will do pretty much the same thing as my patch, with the addition of clearing cur_rng_set_by_user,

Re: [PATCH] hwrng: Explicitly drop current_rng when unregistering rng device

2018-02-04 Thread Keith Packard
Tom Lendacky writes: > A similar fix was already in the cryptodev tree and I thought was part of > a recent pull request. Yup, just saw it on master. I've checked and it will do pretty much the same thing as my patch, with the addition of clearing cur_rng_set_by_user, which is necessary. Thanks

[PATCH] hwrng: Explicitly drop current_rng when unregistering rng device

2018-01-30 Thread Keith Packard
will hang. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/char/hw_random/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 657b8770b6b9..8df3f9f147e2 100644 --- a/drivers/char/hw_random/

[PATCH] hwrng: Explicitly drop current_rng when unregistering rng device

2018-01-30 Thread Keith Packard
will hang. Signed-off-by: Keith Packard --- drivers/char/hw_random/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/core.c b/drivers/char/hw_random/core.c index 657b8770b6b9..8df3f9f147e2 100644 --- a/drivers/char/hw_random/core.c +++ b/drivers/char

Re: [PATCH] drm: Check for lessee in DROP_MASTER ioctl

2018-01-30 Thread Keith Packard
Daniel Vetter <dan...@ffwll.ch> writes: > On Thu, Jan 18, 2018 at 05:51:59PM -0800, Keith Packard wrote: >> Don't let a lessee control what the current DRM master is set to; >> that's the job of the "real" master. Otherwise, the lessee would >> di

Re: [PATCH] drm: Check for lessee in DROP_MASTER ioctl

2018-01-30 Thread Keith Packard
Daniel Vetter writes: > On Thu, Jan 18, 2018 at 05:51:59PM -0800, Keith Packard wrote: >> Don't let a lessee control what the current DRM master is set to; >> that's the job of the "real" master. Otherwise, the lessee would >> disable all access to master operation

Re: [PATCH] USB: misc: chaoskey: Use true and false for boolean values

2018-01-23 Thread Keith Packard
"Gustavo A. R. Silva" <gust...@embeddedor.com> writes: > Assign true or false to boolean variables instead of an integer value. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva <gust...@embeddedor.com> Reviewed

Re: [PATCH] USB: misc: chaoskey: Use true and false for boolean values

2018-01-23 Thread Keith Packard
"Gustavo A. R. Silva" writes: > Assign true or false to boolean variables instead of an integer value. > > This issue was detected with the help of Coccinelle. > > Signed-off-by: Gustavo A. R. Silva Reviewed-by: Keith Packard -- -keith signature.asc Description: PGP signature

[PATCH] drm: Check for lessee in DROP_MASTER ioctl

2018-01-18 Thread Keith Packard
Don't let a lessee control what the current DRM master is set to; that's the job of the "real" master. Otherwise, the lessee would disable all access to master operations for the owner and all lessees under it. This matches the same check made in the SET_MASTER ioctl. Signed-off

[PATCH] drm: Check for lessee in DROP_MASTER ioctl

2018-01-18 Thread Keith Packard
Don't let a lessee control what the current DRM master is set to; that's the job of the "real" master. Otherwise, the lessee would disable all access to master operations for the owner and all lessees under it. This matches the same check made in the SET_MASTER ioctl. Signed-off

[PATCH] drm: move lease init after validation in drm_lease_create

2017-12-20 Thread Keith Packard
are not filled in until the parameters are all validated and the function will succeed. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_lease.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/d

[PATCH] drm: move lease init after validation in drm_lease_create

2017-12-20 Thread Keith Packard
are not filled in until the parameters are all validated and the function will succeed. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_lease.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/drm_lease.c b/drivers/gpu/drm/drm_lease.c

[PATCH] drm: Update edid-derived drm_display_info fields at edid property set [v2]

2017-12-13 Thread Keith Packard
FIXME in drm_mode_connector_update_edid_property about potentially merging that with drm_add_edid_modes to avoid the need for two driver calls. Signed-off-by: Keith Packard <kei...@keithp.com> Reviewed-by: Daniel Vetter <daniel.vet...@ffwll.ch> --- drivers/gpu/drm/drm_connector.c | 13 +

[PATCH] drm: Update edid-derived drm_display_info fields at edid property set [v2]

2017-12-13 Thread Keith Packard
potentially merging that with drm_add_edid_modes to avoid the need for two driver calls. Signed-off-by: Keith Packard Reviewed-by: Daniel Vetter --- drivers/gpu/drm/drm_connector.c | 13 ++ drivers/gpu/drm/drm_edid.c | 53

[PATCH] drm: Update edid-derived drm_display_info fields at edid property set

2017-12-07 Thread Keith Packard
taking a 'const struct edid *' parameter and wanting to pass that along to drm_add_display_info. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_connector.c | 13 ++ drivers/gpu/drm/drm_edid.c | 53 ++--- inclu

[PATCH] drm: Update edid-derived drm_display_info fields at edid property set

2017-12-07 Thread Keith Packard
taking a 'const struct edid *' parameter and wanting to pass that along to drm_add_display_info. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_connector.c | 13 ++ drivers/gpu/drm/drm_edid.c | 53 ++--- include/drm/drm_edid.h | 2

[PATCH 2/3] drm/fb: add support for not enabling fbcon on non-desktop displays [v2]

2017-11-10 Thread Keith Packard
From: Dave Airlie We don't want fbcon to get used on non-desktop dislays, don't pass them as enabled connectors to the fb helper setup. This prevents my HMD from getting disorted fbcon, and from affecting other displays console. v2: Change description from non-standard to

[PATCH 0/3] drm: Add connector info/property for non-desktop [v2]

2017-11-10 Thread Keith Packard
This is the same as the series for non-standard displays but uses the phrase 'non-desktop' instead. No functional changes.

[PATCH 2/3] drm/fb: add support for not enabling fbcon on non-desktop displays [v2]

2017-11-10 Thread Keith Packard
From: Dave Airlie We don't want fbcon to get used on non-desktop dislays, don't pass them as enabled connectors to the fb helper setup. This prevents my HMD from getting disorted fbcon, and from affecting other displays console. v2: Change description from non-standard to non-desktop

[PATCH 0/3] drm: Add connector info/property for non-desktop [v2]

2017-11-10 Thread Keith Packard
This is the same as the series for non-standard displays but uses the phrase 'non-desktop' instead. No functional changes.

[PATCH 1/3] drm: add connector info/property for non-desktop displays [v2]

2017-11-10 Thread Keith Packard
From: Dave Airlie This adds the infrastructure needed to quirk displays using edid and to mark them a non-desktop. A non-desktop display is one which shouldn't normally be included as a part of a desktop environment. This is meant to cover head mounted devices like HTC

[PATCH 3/3] drm/edid: quirk HTC vive headset as non-desktop. [v2]

2017-11-10 Thread Keith Packard
From: Dave Airlie This uses the EDID info from my HTC Vive to mark it as non-desktop. v2: Change description from non-standard to non-desktop Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git

[PATCH 3/3] drm/edid: quirk HTC vive headset as non-desktop. [v2]

2017-11-10 Thread Keith Packard
From: Dave Airlie This uses the EDID info from my HTC Vive to mark it as non-desktop. v2: Change description from non-standard to non-desktop Signed-off-by: Dave Airlie --- drivers/gpu/drm/drm_edid.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_edid.c

[PATCH 1/3] drm: add connector info/property for non-desktop displays [v2]

2017-11-10 Thread Keith Packard
From: Dave Airlie This adds the infrastructure needed to quirk displays using edid and to mark them a non-desktop. A non-desktop display is one which shouldn't normally be included as a part of a desktop environment. This is meant to cover head mounted devices like HTC Vive. v2: Change

Re: [PATCH 5/5] drm: Add four ioctls for managing drm mode object leases [v6]

2017-10-16 Thread Keith Packard
Sean Paul writes: > nit: space before , Thanks. >> +/* Clone the lessor file to create a new file for us */ >> +DRM_DEBUG_LEASE("Allocating lease file\n"); >> +path_get(_file->f_path); > > Please forgive the stupid question, but where is this reference given

Re: [PATCH 5/5] drm: Add four ioctls for managing drm mode object leases [v6]

2017-10-16 Thread Keith Packard
Sean Paul writes: > nit: space before , Thanks. >> +/* Clone the lessor file to create a new file for us */ >> +DRM_DEBUG_LEASE("Allocating lease file\n"); >> +path_get(_file->f_path); > > Please forgive the stupid question, but where is this reference given > up? That's not a

Re: [PATCH 3/5] drm: Add drm_object lease infrastructure [v4]

2017-10-16 Thread Keith Packard
Sean Paul <seanp...@chromium.org> writes: > With these nits fixed, > Reviewed-by: Sean Paul <seanp...@chromium.org> Like this? From 0aa52dd5a0873831c79c14942075354c041e5bed Mon Sep 17 00:00:00 2001 From: Keith Packard <kei...@keithp.com> Date: Mon, 16 Oct 2017 13:41:

Re: [PATCH 3/5] drm: Add drm_object lease infrastructure [v4]

2017-10-16 Thread Keith Packard
Sean Paul writes: > With these nits fixed, > Reviewed-by: Sean Paul Like this? From 0aa52dd5a0873831c79c14942075354c041e5bed Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 16 Oct 2017 13:41:20 -0700 Subject: [PATCH] drm: Mark functions requiring idr_mutex. Add l

Re: [PATCH 0/5]: drm: Add drm mode object leases

2017-10-16 Thread Keith Packard
Daniel Vetter writes: > A bit lacking time to do an in-depth review, but all my major concerns > seem to be addressed. On the series. Thanks much. I sent out a note over the weekend about how we can make the Vulkan API work without the permissions change in the kernel. We need

Re: [PATCH 0/5]: drm: Add drm mode object leases

2017-10-16 Thread Keith Packard
Daniel Vetter writes: > A bit lacking time to do an in-depth review, but all my major concerns > seem to be addressed. On the series. Thanks much. I sent out a note over the weekend about how we can make the Vulkan API work without the permissions change in the kernel. We need to provide

Re: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3]

2017-10-15 Thread Keith Packard
Sean Paul writes: > Sphinx won't pick these up, and will issue warnings. Please update to @ > instead of \param > > If you want to try it out: > make htmldocs Yeah, I was attempting to emulate the existing style. I suggest that a general cleanup to fix the docstrings

Re: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3]

2017-10-15 Thread Keith Packard
Sean Paul writes: > Sphinx won't pick these up, and will issue warnings. Please update to @ > instead of \param > > If you want to try it out: > make htmldocs Yeah, I was attempting to emulate the existing style. I suggest that a general cleanup to fix the docstrings should be in a separate

[PATCH 3/5] drm: Add drm_object lease infrastructure [v4]

2017-10-12 Thread Keith Packard
@gmail.com> * Formatting and whitespace changes Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_auth.c| 29 +++- drivers/gpu/drm/drm_lease.c | 339 ++ include/drm/drm_au

[PATCH 3/5] drm: Add drm_object lease infrastructure [v4]

2017-10-12 Thread Keith Packard
ngs around as it's hanging off a file. * Free the leases IDR when the master is destroyed * _drm_lease_held should look at lessees, not lessor * Allow non-master files to check for lease status Changes in v4, suggested by Dave Airlie * Formatting and whitespace changes Signed-off-by: Kei

[PATCH 2/5] drm: Add new LEASE debug level

2017-10-12 Thread Keith Packard
Separate out lease debugging from the core. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_drv.c | 3 ++- include/drm/drmP.h| 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c

[PATCH 0/5]: drm: Add drm mode object leases

2017-10-12 Thread Keith Packard
New since last time: * Don't lease encoders * Do lease planes * Automatically lease primary and cursor planes for apps which don't set universal_planes * Restrict leases to only contain objects which are actually leasable (connectors, crtcs and planes) * Drop the patch which changes

[PATCH 2/5] drm: Add new LEASE debug level

2017-10-12 Thread Keith Packard
Separate out lease debugging from the core. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_drv.c | 3 ++- include/drm/drmP.h| 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index c0292e5d7281

[PATCH 0/5]: drm: Add drm mode object leases

2017-10-12 Thread Keith Packard
New since last time: * Don't lease encoders * Do lease planes * Automatically lease primary and cursor planes for apps which don't set universal_planes * Restrict leases to only contain objects which are actually leasable (connectors, crtcs and planes) * Drop the patch which changes

[PATCH 4/5] drm: Check mode object lease status in all master ioctl paths [v3]

2017-10-12 Thread Keith Packard
for leasing planes. Signed-off-by: Keith Packard <kei...@keithp.com> Signed-off-by: Dave Airlie <airl...@redhat.com> --- drivers/gpu/drm/drm_auth.c| 2 +- drivers/gpu/drm/drm_encoder.c | 5 +++-- drivers/gpu/drm/drm_mode_config.c | 22 +- drivers/g

[PATCH 4/5] drm: Check mode object lease status in all master ioctl paths [v3]

2017-10-12 Thread Keith Packard
along, we can now centralize most of the lease-based access checks in that function. * A few places skip that API and require in-line checks. Changes for v3 provided by Dave Airlie * remove support for leasing encoders. * add support for leasing planes. Signed-off-by: Keith Packard

[PATCH 1/5] drm/plane: drop num_overlay_planes (v2)

2017-10-12 Thread Keith Packard
From: Dave Airlie In order to implement plane leasing we need to count things, just make the code consistent with the counting code currently used for counting crtcs/encoders/connectors and drop the need for num_overlay_planes. v2: don't forget to assign plane_ptr. (keithp)

[PATCH 1/5] drm/plane: drop num_overlay_planes (v2)

2017-10-12 Thread Keith Packard
From: Dave Airlie In order to implement plane leasing we need to count things, just make the code consistent with the counting code currently used for counting crtcs/encoders/connectors and drop the need for num_overlay_planes. v2: don't forget to assign plane_ptr. (keithp) Signed-off-by: Dave

[PATCH 5/5] drm: Add four ioctls for managing drm mode object leases [v6]

2017-10-12 Thread Keith Packard
ws leasing for objects we wish to allow. Signed-off-by: Keith Packard <kei...@keithp.com> Signed-off-by: Dave Airlie <airl...@redhat.com> --- drivers/gpu/drm/drm_ioctl.c | 4 + drivers/gpu/drm/drm_lease.c | 318 ++ drivers/gpu/d

[PATCH 5/5] drm: Add four ioctls for managing drm mode object leases [v6]

2017-10-12 Thread Keith Packard
the object look ups earlier as a side effect, so we'd exit the ioctl quicker for non-existant objects. * Restrict leases to crtc/connector/planes. This only allows leasing for objects we wish to allow. Signed-off-by: Keith Packard Signed-off-by: Dave Airlie --- drivers/gpu/drm

[PATCH 2/3] drm: Reorganize drm_pending_event to support future event types [v2]

2017-10-12 Thread Keith Packard
ore looking for crtc in queue_vblank_event UMS drivers will oops if we try to get a crtc, so make sure we're modesetting before we try to find a crtc_id to fill into the event. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_atomic.c

[PATCH 2/3] drm: Reorganize drm_pending_event to support future event types [v2]

2017-10-12 Thread Keith Packard
ore looking for crtc in queue_vblank_event UMS drivers will oops if we try to get a crtc, so make sure we're modesetting before we try to find a crtc_id to fill into the event. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_atomic.c | 7 +++--- drivers/gpu/

[PATCH 0/3] drm: Add new vblank ioctls [v4]

2017-10-12 Thread Keith Packard
This series removes portions of the first patch which switched to ktime_t as Arnd Bergmann posted a cleaner patch which did only that. Otherwise, it's the same. -keith

[PATCH 1/3] drm: Widen vblank count to 64-bits [v3]

2017-10-12 Thread Keith Packard
the switch to ktime_t parts. Suggested-by: Michel Dänzer <mic...@daenzer.net> Suggested-by: Daniel Vetter <dan...@ffwll.ch> Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_vblank.c | 104 +-- include/drm/drm_vblank.h

[PATCH 0/3] drm: Add new vblank ioctls [v4]

2017-10-12 Thread Keith Packard
This series removes portions of the first patch which switched to ktime_t as Arnd Bergmann posted a cleaner patch which did only that. Otherwise, it's the same. -keith

[PATCH 1/3] drm: Widen vblank count to 64-bits [v3]

2017-10-12 Thread Keith Packard
the switch to ktime_t parts. Suggested-by: Michel Dänzer Suggested-by: Daniel Vetter Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_vblank.c | 104 +-- include/drm/drm_vblank.h | 10 +++-- 2 files changed, 78 insertions(+), 36 deletions(-) diff

[PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3]

2017-10-12 Thread Keith Packard
* Document that the timestamp in the query and event are that of the first pixel leaving the display engine for the display (using the same wording as the Vulkan spec). Suggested-by: Michel Dänzer <mic...@daenzer.net> Acked-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Keith Pa

[PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3]

2017-10-12 Thread Keith Packard
are that of the first pixel leaving the display engine for the display (using the same wording as the Vulkan spec). Suggested-by: Michel Dänzer Acked-by: Dave Airlie Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_internal.h | 6 ++ drivers/gpu/drm/drm_ioctl.c| 2 + drivers/gpu/drm

Re: [PATCH 2/6] drm: Allow render nodes to query display objects

2017-10-12 Thread Keith Packard
Daniel Vetter writes: > One more that came up on irc after discussion why this is needed: The > userspace side using this won't work on split gpus where the render node > has 0 displays, and hence where you really need to query the compositor > anyway. Agreed -- using the X

Re: [PATCH 2/6] drm: Allow render nodes to query display objects

2017-10-12 Thread Keith Packard
Daniel Vetter writes: > One more that came up on irc after discussion why this is needed: The > userspace side using this won't work on split gpus where the render node > has 0 displays, and hence where you really need to query the compositor > anyway. Agreed -- using the X connection to get

Re: [PATCH 2/6] drm: Allow render nodes to query display objects

2017-10-12 Thread Keith Packard
Daniel Vetter writes: > So given the huge possibilities of abuse, do we really, really need all > this, and is there not any way to create a bit of protocol to pass the > relevant data from X to clients? From your presentation is sounded like > current xrandr is (almost) there

Re: [PATCH 2/6] drm: Allow render nodes to query display objects

2017-10-12 Thread Keith Packard
Daniel Vetter writes: > So given the huge possibilities of abuse, do we really, really need all > this, and is there not any way to create a bit of protocol to pass the > relevant data from X to clients? From your presentation is sounded like > current xrandr is (almost) there ... Yeah, it's

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-12 Thread Keith Packard
ormat. This patch is better than the portion of my patch which does the same thing as it uses the ktime APIs consistently and doesn't assume that ktime_t is in ns. Thanks much! Reviewed-by: Keith Packard <kei...@keithp.com> -- -keith signature.asc Description: PGP signature

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-12 Thread Keith Packard
better than the portion of my patch which does the same thing as it uses the ktime APIs consistently and doesn't assume that ktime_t is in ns. Thanks much! Reviewed-by: Keith Packard -- -keith signature.asc Description: PGP signature

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-11 Thread Keith Packard
Sean Paul writes: > Would it be easier for you to respin this into your series, or for me > to just apply it to drm-misc-next? Yeah, I don't see any particular hurry to getting just the time widening patch merged as it doesn't change any external interfaces. I'll go ahead

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-11 Thread Keith Packard
Sean Paul writes: > Would it be easier for you to respin this into your series, or for me > to just apply it to drm-misc-next? Yeah, I don't see any particular hurry to getting just the time widening patch merged as it doesn't change any external interfaces. I'll go ahead and respin my series

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-11 Thread Keith Packard
Sean Paul writes: > It looks like perhaps Keith missed one of the comment tweaks that you have > below. > > Keith, perhaps you can rebase your widening patch on this one? I'm easy; either order works for me just fine. Having the time change separated from the sequence

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-11 Thread Keith Packard
Sean Paul writes: > It looks like perhaps Keith missed one of the comment tweaks that you have > below. > > Keith, perhaps you can rebase your widening patch on this one? I'm easy; either order works for me just fine. Having the time change separated from the sequence change might be nice? --

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-11 Thread Keith Packard
Arnd Bergmann writes: > That is an interesting coincidence, I created my patch earlier this week > without having any idea that others were looking at the same files. My requirements were to support 64-bit vblank counts and ns precision vblank timing for Vulkan; obviously using

Re: [PATCH 1/2] drm: vblank: use ktime_t instead of timeval

2017-10-11 Thread Keith Packard
Arnd Bergmann writes: > That is an interesting coincidence, I created my patch earlier this week > without having any idea that others were looking at the same files. My requirements were to support 64-bit vblank counts and ns precision vblank timing for Vulkan; obviously using ktime_t was a

[PATCH 2/3] drm: Reorganize drm_pending_event to support future event types [v2]

2017-10-10 Thread Keith Packard
ore looking for crtc in queue_vblank_event UMS drivers will oops if we try to get a crtc, so make sure we're modesetting before we try to find a crtc_id to fill into the event. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_atomic.c

[PATCH 2/3] drm: Reorganize drm_pending_event to support future event types [v2]

2017-10-10 Thread Keith Packard
ore looking for crtc in queue_vblank_event UMS drivers will oops if we try to get a crtc, so make sure we're modesetting before we try to find a crtc_id to fill into the event. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_atomic.c | 7 --- drivers/gpu/

[PATCH 1/3] drm: Widen vblank UAPI to 64 bits. Change vblank time to ktime_t [v2]

2017-10-10 Thread Keith Packard
count as before. * Leave driver API with 32-bit vblank count Suggested-by: Michel Dänzer <mic...@daenzer.net> Suggested-by: Daniel Vetter <dan...@ffwll.ch> Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_vblank.c | 214 +++---

[PATCH 1/3] drm: Widen vblank UAPI to 64 bits. Change vblank time to ktime_t [v2]

2017-10-10 Thread Keith Packard
count as before. * Leave driver API with 32-bit vblank count Suggested-by: Michel Dänzer Suggested-by: Daniel Vetter Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_vblank.c | 214 +++ include/drm/drm_drv.h| 2 +- include/drm/drm_vblank.h

[PATCH 4/6] drm: Add drm_object lease infrastructure [v4]

2017-10-10 Thread Keith Packard
@gmail.com> * Formatting and whitespace changes Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/Makefile | 2 +- drivers/gpu/drm/drm_auth.c| 29 +++- drivers/gpu/drm/drm_lease.c | 379 ++ include/drm/drm_au

[PATCH 4/6] drm: Add drm_object lease infrastructure [v4]

2017-10-10 Thread Keith Packard
ngs around as it's hanging off a file. * Free the leases IDR when the master is destroyed * _drm_lease_held should look at lessees, not lessor * Allow non-master files to check for lease status Changes in v4, suggested by Dave Airlie * Formatting and whitespace changes Signed-off-by: Kei

[PATCH 6/6] drm: Add four ioctls for managing drm mode object leases [v5]

2017-10-10 Thread Keith Packard
_lease_idr_object * Pad lease ioctl structures to align on 64-bit boundaries Changes for v5 suggested by Dave Airlie <airl...@gmail.com> * Check for non-negative object_id in create_lease to avoid debug output from the kernel. Signed-off-by: Keith Packard <kei...@keithp.com> --

[PATCH 6/6] drm: Add four ioctls for managing drm mode object leases [v5]

2017-10-10 Thread Keith Packard
Changes for v5 suggested by Dave Airlie * Check for non-negative object_id in create_lease to avoid debug output from the kernel. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_ioctl.c | 4 + drivers/gpu/drm/drm_lease.c | 282 +++ drivers

[PATCH 3/6] drm: Add new LEASE debug level

2017-10-10 Thread Keith Packard
Separate out lease debugging from the core. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_drv.c | 3 ++- include/drm/drmP.h| 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c

[PATCH 3/6] drm: Add new LEASE debug level

2017-10-10 Thread Keith Packard
Separate out lease debugging from the core. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_drv.c | 3 ++- include/drm/drmP.h| 4 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index c0292e5d7281

[PATCH 5/6] drm: Check mode object lease status in all master ioctl paths [v2]

2017-10-10 Thread Keith Packard
nd API to pass the file_priv along, we can now centralize most of the lease-based access checks in that function. A few places skip that API and require in-line checks. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_auth.c| 2 +- drivers/gpu/drm/drm_connec

[PATCH 5/6] drm: Check mode object lease status in all master ioctl paths [v2]

2017-10-10 Thread Keith Packard
, we can now centralize most of the lease-based access checks in that function. A few places skip that API and require in-line checks. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_auth.c| 2 +- drivers/gpu/drm/drm_connector.c | 5 +++-- drivers/gpu/drm/drm_encoder.c | 8

[PATCH 0/6] drm: Add drm mode object leases

2017-10-10 Thread Keith Packard
New since last time: * Fix vboxvideo driver in staging * Fixed some formatting and whitespace errors (Dave Airlie) * Explain the odd use of the idr interface for leases (Dave Airlie) * Disallow negative object_id in lease creation (Dave Airlie) It's also been rebased on top of the

[PATCH 0/6] drm: Add drm mode object leases

2017-10-10 Thread Keith Packard
New since last time: * Fix vboxvideo driver in staging * Fixed some formatting and whitespace errors (Dave Airlie) * Explain the odd use of the idr interface for leases (Dave Airlie) * Disallow negative object_id in lease creation (Dave Airlie) It's also been rebased on top of the

[PATCH 2/6] drm: Allow render nodes to query display objects

2017-10-10 Thread Keith Packard
This allows an application to discover what display resources are available before requesting a lease from the X server. Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/drm/drm_ioctl.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff

[PATCH 1/6] drm: Pass struct drm_file * to __drm_mode_object_find [v2]

2017-10-10 Thread Keith Packard
This will allow __drm_mode_object_file to be extended to perform access control checks based on the file in use. v2: Also fix up vboxvideo driver in staging Suggested-by: Daniel Vetter <daniel.vet...@ffwll.ch> Signed-off-by: Keith Packard <kei...@keithp.com> --- drivers/gpu/dr

[PATCH 2/6] drm: Allow render nodes to query display objects

2017-10-10 Thread Keith Packard
This allows an application to discover what display resources are available before requesting a lease from the X server. Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_ioctl.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm

[PATCH 1/6] drm: Pass struct drm_file * to __drm_mode_object_find [v2]

2017-10-10 Thread Keith Packard
This will allow __drm_mode_object_file to be extended to perform access control checks based on the file in use. v2: Also fix up vboxvideo driver in staging Suggested-by: Daniel Vetter Signed-off-by: Keith Packard --- drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 16

[PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3]

2017-10-10 Thread Keith Packard
* Document that the timestamp in the query and event are that of the first pixel leaving the display engine for the display (using the same wording as the Vulkan spec). Suggested-by: Michel Dänzer <mic...@daenzer.net> Acked-by: Dave Airlie <airl...@redhat.com> Signed-off-by: Keith Pa

[PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v3]

2017-10-10 Thread Keith Packard
are that of the first pixel leaving the display engine for the display (using the same wording as the Vulkan spec). Suggested-by: Michel Dänzer Acked-by: Dave Airlie Signed-off-by: Keith Packard --- drivers/gpu/drm/drm_internal.h | 6 ++ drivers/gpu/drm/drm_ioctl.c| 2 + drivers/gpu/drm

[PATCH 0/3] drm: add new vblank ioctls [v3]

2017-10-10 Thread Keith Packard
This version removes the FIRST_PIXEL_OUT flag as the existing code already conforms to that requirement. It has also been rebased to drm-next.

[PATCH 0/3] drm: add new vblank ioctls [v3]

2017-10-10 Thread Keith Packard
This version removes the FIRST_PIXEL_OUT flag as the existing code already conforms to that requirement. It has also been rebased to drm-next.

Re: [PATCH 6/6] drm: Add four ioctls for managing drm mode object leases [v4]

2017-10-10 Thread Keith Packard
Dave Airlie writes: >> +*/ >> + ret = idr_alloc(, _lease_idr_object , object_id, >> object_id + 1, GFP_KERNEL); > > In current kernels, the idr_alloc warns if start < 0, so if object_id > is a negative signed integer, which your > igt tests

Re: [PATCH 6/6] drm: Add four ioctls for managing drm mode object leases [v4]

2017-10-10 Thread Keith Packard
Dave Airlie writes: >> +*/ >> + ret = idr_alloc(, _lease_idr_object , object_id, >> object_id + 1, GFP_KERNEL); > > In current kernels, the idr_alloc warns if start < 0, so if object_id > is a negative signed integer, which your > igt tests actually make it. > > So

Re: [PATCH 3/3] drm: Add CRTC_GET_SEQUENCE and CRTC_QUEUE_SEQUENCE ioctls [v2]

2017-10-09 Thread Keith Packard
Daniel Vetter writes: > I just figured that -modesetting would be the simplest domenstration > vehicle, since the vulkan patches don't look ready yet. I need fully > reviewed userspace before we can land any kernel stuff. Doing > the quick modesetting conversion would unblock.

  1   2   3   4   >