Re: [PATCH RFC 03/18] rust: drm: file: Add File abstraction

2023-04-05 Thread Daniel Vetter
raction > here: > > similar to > https://lore.kernel.org/rust-for-linux/ZA9l0EHCRRr%2Fmyoq@boqun-archlinux > > * Define Device as tranparent represention of struct drm_device: > > #[repr(transparent)] > struct Device(Opaque); > > * impl `AlwaysRefCounted`[1] for `Device`, therefore we can use > `ARef`[2] as a smart pointer to `drm_device`. > > * drm_device related methods are still implemented in `impl Device` > > * In `open_callback`, we can just get a `` from `*mut > bindings::drm_device` unsafely, and that's all. Or introduce a helper > function if we want: > > pub unsafe fn with_device(ptr: *mut drm_device, f: F) -> Result > where > F: FnOnce() -> Result > { > let d = unsafe { &*ptr }; > f(d) > } > > The main difference is that we now treat a pointer to drm_device as a > reference to the device, not the owner. > > It seems we need to also change our driver/device framework to use this > approach, but it looks better to me. So I really don't have enough rust clue to have any useful opinion on how the glue should look like, but semantically the struct drm_file should only ever be borrowed as a parameter to a driver hook, so that rust can guarantee that the driver doesn't do anything funny and uses it beyond the end of that function. This holds for all the callbacks like open/close or also all the ioctl. The other semantic thing is that that the ioctls should be able to rely on open having fully constructed the thing. I think the trait and dependent type stuff ensure that? What I've missed (but maybe just looked in the wrong place) is that the ioctl support (and really anything else where the driver gets a struct drm_file on the C side, but I don't think there is anything else) should also make sure you get the right driver-specific type and not something else. I did notice the FIXME in the first patch, I guess if it makes landing all this easier we could also keep this as a todo item to improve once things landed. That btw holds for a lot of the big "how to map semantics correctly to rust" questions I'm throwing up here. Maybe a Documentation/gpu/rust.rst file would be good to include, with these todo items noted instead of just FIXME sprinkled in patches? At least for things that will take more effort to polish. -Daniel > > Regards, > Boqun > > [1]: https://rust-for-linux.github.io/docs/kernel/trait.AlwaysRefCounted.html > [2]: https://rust-for-linux.github.io/docs/kernel/struct.ARef.html > > > ~Faith -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH RFC 04/18] rust: drm: gem: Add GEM object abstraction

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 01:19:47PM +0200, Miguel Ojeda wrote: > On Wed, Apr 5, 2023 at 1:08 PM Daniel Vetter wrote: > > > > Uh all the rust helper wrappers for all the kernel in a single file does > > not sound good. Can we not split these up into each subsystem, and t

Re: [PATCH RFC 08/18] rust: dma_fence: Add DMA Fence abstraction

2023-04-05 Thread Daniel Vetter
dd(1, > Ordering::Relaxed); > + > +// SAFETY: The pointer is valid, so pointers to members are too. > +// After this, all fields are initialized. > +unsafe { > +addr_of_mut!((*p).inner).write(inner); > +bindings::__spin_lock_init( > +addr_of_mut!((*p).lock) as *mut _, > +self.lock_name.as_char_ptr(), > +self.lock_key.get(), > +); > +bindings::dma_fence_init( > +addr_of_mut!((*p).fence), > +VTABLE, > +addr_of_mut!((*p).lock) as *mut _, > +self.start + context as u64, > +seqno, > +); > +}; > + > +Ok(UniqueFence(p)) > +} > +} > + > +/// A DMA Fence Chain Object > +/// > +/// # Invariants > +/// ptr is a valid pointer to a dma_fence_chain which we own. > +pub struct FenceChain { > +ptr: *mut bindings::dma_fence_chain, > +} > + > +impl FenceChain { > +/// Create a new DmaFenceChain object. > +pub fn new() -> Result { > +// SAFETY: This function is safe to call and takes no arguments. > +let ptr = unsafe { bindings::dma_fence_chain_alloc() }; > + > +if ptr.is_null() { > +Err(ENOMEM) > +} else { > +Ok(FenceChain { ptr }) > +} > +} > + > +/// Convert the DmaFenceChain into the underlying raw pointer. > +/// > +/// This assumes the caller will take ownership of the object. > +pub(crate) fn into_raw(self) -> *mut bindings::dma_fence_chain { > +let ptr = self.ptr; > +core::mem::forget(self); > +ptr > +} > +} > + > +impl Drop for FenceChain { > +fn drop( self) { > +// SAFETY: We own this dma_fence_chain. > +unsafe { bindings::dma_fence_chain_free(self.ptr) }; > +} > +} > diff --git a/rust/kernel/lib.rs b/rust/kernel/lib.rs > index cb23d24c6718..31866069e0bc 100644 > --- a/rust/kernel/lib.rs > +++ b/rust/kernel/lib.rs > @@ -36,6 +36,8 @@ mod allocator; > mod build_assert; > pub mod delay; > pub mod device; > +#[cfg(CONFIG_DMA_SHARED_BUFFER)] > +pub mod dma_fence; > pub mod driver; > #[cfg(CONFIG_RUST_DRM)] > pub mod drm; > > -- > 2.35.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH RFC 04/18] rust: drm: gem: Add GEM object abstraction

2023-04-05 Thread Daniel Vetter
as *const _; > +core::mem::forget(self); > + > +ObjectRef { ptr } > +} > +} > + > +impl Drop for UniqueObjectRef { > +fn drop( self) { > +// SAFETY: Having a UniqueObjectRef implies holding a GEM > +// reference. The free callback will take care of deallocation. > +unsafe { > +bindings::drm_gem_object_put((*self.ptr).gem_obj()); > +} > +} > +} > + > +impl Deref for UniqueObjectRef { > +type Target = T; > + > +fn deref() -> ::Target { > +// SAFETY: The pointer is valid per the invariant > +unsafe { &*self.ptr } > +} > +} > + > +impl DerefMut for UniqueObjectRef { > +fn deref_mut( self) -> Self::Target { > +// SAFETY: The pointer is valid per the invariant > +unsafe { *self.ptr } > +} > +} > + > +pub(super) fn create_fops() -> bindings::file_operations { > +bindings::file_operations { > +owner: core::ptr::null_mut(), > +open: Some(bindings::drm_open), > +release: Some(bindings::drm_release), > +unlocked_ioctl: Some(bindings::drm_ioctl), > +#[cfg(CONFIG_COMPAT)] > +compat_ioctl: Some(bindings::drm_compat_ioctl), > +#[cfg(not(CONFIG_COMPAT))] > +compat_ioctl: None, > +poll: Some(bindings::drm_poll), > +read: Some(bindings::drm_read), > +llseek: Some(bindings::noop_llseek), > +mmap: Some(bindings::drm_gem_mmap), > +..Default::default() > +} > +} > diff --git a/rust/kernel/drm/mod.rs b/rust/kernel/drm/mod.rs > index a767942d0b52..c44760a1332f 100644 > --- a/rust/kernel/drm/mod.rs > +++ b/rust/kernel/drm/mod.rs > @@ -5,4 +5,5 @@ > pub mod device; > pub mod drv; > pub mod file; > +pub mod gem; > pub mod ioctl; > > -- > 2.35.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 00/10] Xe DRM scheduler and long running workload plans

2023-04-05 Thread Daniel Vetter
On Wed, 5 Apr 2023 at 11:57, Christian König wrote: > > Am 05.04.23 um 11:07 schrieb Daniel Vetter: > > [SNIP] > >> I would approach it from the complete other side. This component here is a > >> tool to decide what job should run next. > >> > &

Re: [PULL] drm-intel-fixes

2023-04-05 Thread Daniel Vetter
++ > drivers/gpu/drm/i915/gt/uc/intel_huc.h | 7 +-- > drivers/gpu/drm/i915/i915_perf.c | 6 +++--- > 6 files changed, 25 insertions(+), 14 deletions(-) > > -- > Jani Nikula, Intel Open Source Graphics Center -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH 1/8] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 11:26:51AM +0200, Thomas Zimmermann wrote: > Hi > > Am 05.04.23 um 10:59 schrieb Daniel Vetter: > > On Wed, Apr 05, 2023 at 10:07:54AM +0200, Thomas Zimmermann wrote: > > > Hi > > > > > > Am 05.04.23 um 09:49 schrieb Thomas

Re: fdinfo blew up? (Was: [RFC PATCH 0/4] uapi, drm: Add and implement RLIMIT_GPUPRIO)

2023-04-05 Thread Daniel Vetter
On Wed, 5 Apr 2023 at 11:11, Tvrtko Ursulin wrote: > > > On 05/04/2023 09:28, Daniel Vetter wrote: > > On Tue, 4 Apr 2023 at 12:45, Tvrtko Ursulin > > wrote: > >> > >> > >> Hi, > >> > >> On 03/04/2023 20:40, Joshua Ashton wro

Re: [PATCH 1/8] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 10:19:55AM +0200, Thomas Zimmermann wrote: > Hi > > Am 04.04.23 um 22:18 schrieb Daniel Vetter: > > This one nukes all framebuffers, which is a bit much. In reality > > gma500 is igpu and never shipped with anything discrete, so there should >

Re: [RFC PATCH 00/10] Xe DRM scheduler and long running workload plans

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 10:53:26AM +0200, Christian König wrote: > Am 05.04.23 um 10:34 schrieb Daniel Vetter: > > On Wed, Apr 05, 2023 at 09:41:23AM +0200, Christian König wrote: > > > Am 04.04.23 um 15:37 schrieb Matthew Brost: > > > > On Tue, Apr 04, 2023 at 11:

Re: [PATCH 1/8] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 10:07:54AM +0200, Thomas Zimmermann wrote: > Hi > > Am 05.04.23 um 09:49 schrieb Thomas Zimmermann: > > Hi > > > > Am 04.04.23 um 22:18 schrieb Daniel Vetter: > > > This one nukes all framebuffers, which is a bit much. In reality &g

Re: [PATCH 7/8] video/aperture: Only remove sysfb on the default vga pci device

2023-04-05 Thread Daniel Vetter
On Tue, Apr 04, 2023 at 01:59:33PM -0700, Aaron Plattner wrote: > On 4/4/23 1:18 PM, Daniel Vetter wrote: > > Instead of calling aperture_remove_conflicting_devices() to remove the > > conflicting devices, just call to aperture_detach_devices() to detach > > the device that

Re: [PATCH 0/3] Revert lima fdinfo patchset

2023-04-05 Thread Daniel Vetter
; Regards, > Qiang > > On Wed, Apr 5, 2023 at 3:28 AM Daniel Vetter wrote: > > > > On Tue, Apr 04, 2023 at 04:17:33PM +0100, Emil Velikov wrote: > > > On Tue, 4 Apr 2023 at 08:13, wrote: > > > > > > > > From: Qiang Yu > > > > > > &g

Re: [RFC PATCH 00/10] Xe DRM scheduler and long running workload plans

2023-04-05 Thread Daniel Vetter
ce > > > >drm/sched: Start run wq before TDR in drm_sched_start > > > >drm/sched: Submit job before starting TDR > > > >drm/sched: Add helper to set TDR timeout > > > >drm/syncobj: Warn on long running dma-fences > > > > > > > > Thomas Hellström (2): > > > >dma-buf/dma-fence: Introduce long-running completion fences > > > >drm/sched: Support long-running sched entities > > > > > > > > drivers/dma-buf/dma-fence.c | 142 +++--- > > > > drivers/dma-buf/dma-resv.c | 5 + > > > > drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 14 +- > > > > drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +- > > > > drivers/gpu/drm/drm_syncobj.c | 5 +- > > > > drivers/gpu/drm/etnaviv/etnaviv_sched.c | 5 +- > > > > drivers/gpu/drm/lima/lima_sched.c | 5 +- > > > > drivers/gpu/drm/msm/adreno/adreno_device.c | 6 +- > > > > drivers/gpu/drm/msm/msm_ringbuffer.c| 5 +- > > > > drivers/gpu/drm/panfrost/panfrost_job.c | 5 +- > > > > drivers/gpu/drm/scheduler/sched_entity.c| 127 +++-- > > > > drivers/gpu/drm/scheduler/sched_fence.c | 6 +- > > > > drivers/gpu/drm/scheduler/sched_main.c | 278 +++- > > > > drivers/gpu/drm/v3d/v3d_sched.c | 25 +- > > > > include/drm/gpu_scheduler.h | 130 +++-- > > > > include/linux/dma-fence.h | 60 - > > > > 16 files changed, 649 insertions(+), 184 deletions(-) > > > > > > > > -- > > > > 2.34.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 00/10] Xe DRM scheduler and long running workload plans

2023-04-05 Thread Daniel Vetter
> > > > drm/sched: Add helper to set TDR timeout > > > > drm/syncobj: Warn on long running dma-fences > > > > > > > > Thomas Hellström (2): > > > > dma-buf/dma-fence: Introduce long-running completion fences > > > > drm/sched: Support long-running sched entities > > > > > > > >drivers/dma-buf/dma-fence.c | 142 +++--- > > > >drivers/dma-buf/dma-resv.c | 5 + > > > >drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 14 +- > > > >drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +- > > > >drivers/gpu/drm/drm_syncobj.c | 5 +- > > > >drivers/gpu/drm/etnaviv/etnaviv_sched.c | 5 +- > > > >drivers/gpu/drm/lima/lima_sched.c | 5 +- > > > >drivers/gpu/drm/msm/adreno/adreno_device.c | 6 +- > > > >drivers/gpu/drm/msm/msm_ringbuffer.c| 5 +- > > > >drivers/gpu/drm/panfrost/panfrost_job.c | 5 +- > > > >drivers/gpu/drm/scheduler/sched_entity.c| 127 +++-- > > > >drivers/gpu/drm/scheduler/sched_fence.c | 6 +- > > > >drivers/gpu/drm/scheduler/sched_main.c | 278 > > > > +++- > > > >drivers/gpu/drm/v3d/v3d_sched.c | 25 +- > > > >include/drm/gpu_scheduler.h | 130 +++-- > > > >include/linux/dma-fence.h | 60 - > > > >16 files changed, 649 insertions(+), 184 deletions(-) > > > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 0/4] uapi, drm: Add and implement RLIMIT_GPUPRIO

2023-04-05 Thread Daniel Vetter
n't thought out well enough. Adding at least some of the people who probably should be cc'ed on this. Please add more. Cheers, Daniel > > Regards, > > Tvrtko > > [1] > https://lore.kernel.org/dri-devel/20220407152806.3387898-1-tvrtko.ursu...@linux.intel.com/T/ > [2] > https://lore.kernel.org/lkml/20221019173254.3361334-4-tvrtko.ursu...@linux.intel.com/T/#u > [3] > https://lore.kernel.org/lkml/20230314141904.1210824-1-tvrtko.ursu...@linux.intel.com/ -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

[PATCH] drm/atomic-helper: Don't set deadline for modesets

2023-04-05 Thread Daniel Vetter
tomic-helper: Set fence deadline for vblank") Cc: Rob Clark Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Reported-by: Dmitry Baryshkov Tested-by: Dmitry Baryshkov # test patch only Cc: Dmitry Baryshkov Signed-off-by: Daniel Vetter --- drive

Re: [PATCH] drm/vblank: Simplify drm_dev_has_vblank()

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 12:00:23AM +0300, Ville Syrjälä wrote: > On Tue, Apr 04, 2023 at 10:46:00PM +0200, Daniel Vetter wrote: > > On Mon, Apr 03, 2023 at 09:07:35AM -0700, Rob Clark wrote: > > > From: Rob Clark > > > > > > What does vblank have to do with nu

Re: [PATCH] drm/atomic-helper: Do not assume vblank is always present

2023-04-05 Thread Daniel Vetter
return -EINVAL; > > > > Rob already posted more or less the same fix: > > https://lore.kernel.org/lkml/caf6aegsdt95-uakcv2+hdmlkd2xwfpen+fmudtrmc-ps7wb...@mail.gmail.com/T/ Yeah I pushed it to drm-misc-next yesterday, please check that works. Also note that we still (in some cases at least where) need another fix to handle the crtc on/off state transitions (but only for drivers which do have vblank), I'll send that out asap. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH v10 11/15] drm/atomic-helper: Set fence deadline for vblank

2023-04-05 Thread Daniel Vetter
On Wed, Apr 05, 2023 at 12:53:29AM +0300, Dmitry Baryshkov wrote: > On 04/04/2023 22:16, Daniel Vetter wrote: > > On Tue, Apr 04, 2023 at 08:22:05PM +0300, Dmitry Baryshkov wrote: > > > On 08/03/2023 17:53, Rob Clark wrote: > > > > From: Rob Clark > > > &

Re: [PATCH] drm/vblank: Simplify drm_dev_has_vblank()

2023-04-04 Thread Daniel Vetter
gt; bool drm_dev_has_vblank(const struct drm_device *dev) > { > - return dev->num_crtcs != 0; > + return !!dev->vblank; > } > EXPORT_SYMBOL(drm_dev_has_vblank); > > -- > 2.39.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH v2] drm/vblank: Fix for drivers that do not drm_vblank_init()

2023-04-04 Thread Daniel Vetter
> > diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c > > > index 299fa2a19a90..877e2067534f 100644 > > > --- a/drivers/gpu/drm/drm_vblank.c > > > +++ b/drivers/gpu/drm/drm_vblank.c > > > @@ -996,10 +996,16 @@ EXPORT_SYMBOL(drm_crtc_vblank_count_and_time); > > > int drm_crtc_next_vblank_start(struct drm_crtc *crtc, ktime_t > > > *vblanktime) > > > { > > > unsigned int pipe = drm_crtc_index(crtc); > > > - struct drm_vblank_crtc *vblank = >dev->vblank[pipe]; > > > - struct drm_display_mode *mode = >hwmode; > > > + struct drm_vblank_crtc *vblank; > > > + struct drm_display_mode *mode; > > > u64 vblank_start; > > > > > > + if (!drm_dev_has_vblank(crtc->dev)) > > > + return -EINVAL; > > > + > > > + vblank = >dev->vblank[pipe]; > > > + mode = >hwmode; > > > + > > > if (!vblank->framedur_ns || !vblank->linedur_ns) > > > return -EINVAL; > > > > > > -- > > > 2.39.2 > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 08/10] dma-buf/dma-fence: Introduce long-running completion fences

2023-04-04 Thread Daniel Vetter
On Tue, Apr 04, 2023 at 08:19:37PM +, Matthew Brost wrote: > On Tue, Apr 04, 2023 at 10:11:59PM +0200, Daniel Vetter wrote: > > On Tue, 4 Apr 2023 at 22:04, Matthew Brost wrote: > > > > > > On Tue, Apr 04, 2023 at 09:00:59PM +0200, Daniel Vetter wrote: > >

[PATCH 7/8] video/aperture: Only remove sysfb on the default vga pci device

2023-04-04 Thread Daniel Vetter
16303#c28 Signed-off-by: Daniel Vetter Cc: Aaron Plattner Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Helge Deller Cc: Sam Ravnborg Cc: Alex Deucher Cc: # v5.19+ (if someone else does the backport) --- drivers/video/aperture.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-)

[PATCH 8/8] fbdev: Simplify fb_is_primary_device for x86

2023-04-04 Thread Daniel Vetter
Signed-off-by: Daniel Vetter Cc: Daniel Vetter Cc: Helge Deller Cc: Daniel Vetter Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Cc: Thomas Gleixner Cc: Ingo Molnar Cc: Borislav Petkov Cc: Dave Hansen Cc: x...@kernel.org Cc: "H. Peter Anvin" --- arch/x86/video/fbdev.c | 13 +

[PATCH 6/8] video/aperture: Drop primary argument

2023-04-04 Thread Daniel Vetter
in an actual driver left to touch. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: "K. Y. Srinivasan" Cc: Haiyang Zhang Cc: Wei Liu Cc: Dexuan Cui Cc:

[PATCH 5/8] video/aperture: Move vga handling to pci function

2023-04-04 Thread Daniel Vetter
function, and the other in the generic one. v2: Rebase. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fb...@vger.kernel.org --- drivers/video/aperture.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git

[PATCH 4/8] video/aperture: Only kick vgacon when the pdev is decoding vga

2023-04-04 Thread Daniel Vetter
a special case for kicking out the vgacon driver only (Thomas) References: https://bugzilla.kernel.org/show_bug.cgi?id=216303 Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fb...@vger.kernel.org --- drivers/video/aperture.c | 16

[PATCH 2/8] video/aperture: use generic code to figure out the vga default device

2023-04-04 Thread Daniel Vetter
end commit message trying to summarize various discussions. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Helge Deller Cc: linux-fb...@vger.kernel.org Cc: Bjorn Helgaas Cc: linux-...@vger.kernel.org --- drivers/video/aperture.c | 6 ++ 1 file changed, 2

[PATCH 3/8] drm/aperture: Remove primary argument

2023-04-04 Thread Daniel Vetter
: - Reorder to avoid compile fail (Thomas) - Include gma500, which retained it's called to the non-pci version. Signed-off-by: Daniel Vetter Cc: Thomas Zimmermann Cc: Javier Martinez Canillas Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Deepak Rawat Cc: Neil Armstrong Cc: Kevin Hilman Cc: Jerome

[PATCH 1/8] drm/gma500: Use drm_aperture_remove_conflicting_pci_framebuffers

2023-04-04 Thread Daniel Vetter
only use non-pci helper, then we don't get the vga handling, and subsequent refactoring to untangle these special cases won't work. It's not pretty, but the simplest fix (since gma500 really is the only quirky pci driver like this we have) is to just have both calls. Signed-off-by: Daniel Vetter

Re: [RFC PATCH 08/10] dma-buf/dma-fence: Introduce long-running completion fences

2023-04-04 Thread Daniel Vetter
On Tue, 4 Apr 2023 at 22:04, Matthew Brost wrote: > > On Tue, Apr 04, 2023 at 09:00:59PM +0200, Daniel Vetter wrote: > > On Tue, 4 Apr 2023 at 15:10, Christian König > > wrote: > > > > > > Am 04.04.23 um 14:54 schrieb Thomas Hellström: > > > >

[PATCH 2/3] drm/fb-helper: drop redundant pixclock check from drm_fb_helper_set_par()

2023-04-04 Thread Daniel Vetter
The fb_check_var hook is supposed to validate all this stuff. Any errors from fb_set_par are considered driver/hw issues and resulting in dmesg warnings. Luckily we do fix up the pixclock already, so this is all fine. Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc

[PATCH 1/3] drm/fb-helper: set x/yres_virtual in drm_fb_helper_check_var

2023-04-04 Thread Daniel Vetter
com/bug?id=c5faf983bfa4a607de530cd3bb00bf06cefc Cc: sta...@vger.kernel.org # v5.4+ Cc: Daniel Vetter Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_fb_helper.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drive

[PATCH 3/3] drm/fb-helper: fix input validation gaps in check_var

2023-04-04 Thread Daniel Vetter
. Therefore fixing all this just for drm fbdev emulation is good enough. Note that var->active is not set or validated. This is just control flow for fbmem.c and needs to be validated in there as needed. Signed-off-by: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmerm

[PATCH] fbmem: Reject FB_ACTIVATE_KD_TEXT from userspace

2023-04-04 Thread Daniel Vetter
. Signed-off-by: Daniel Vetter Fixes: dc5bdb68b5b3 ("drm/fb-helper: Fix vt restore") Cc: Alex Deucher Cc: shl...@fastmail.com Cc: Michel Dänzer Cc: Noralf Trønnes Cc: Thomas Zimmermann Cc: Daniel Vetter Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: David Airlie Cc: Danie

Re: [PATCH 1/3] Revert "drm/lima: add show_fdinfo for drm usage stats"

2023-04-04 Thread Daniel Vetter
t; - > - seq_printf(m, "drm-engine-%s:\t%llu ns\n", sched->name, > usage[i]); > - } > -} > - > -static const struct file_operations lima_drm_driver_fops = { > - .owner = THIS_MODULE, > - DRM_GEM_FOPS, > - .show_fdinfo = lima_drm_driver_show_fdinfo, > -}; > +DEFINE_DRM_GEM_FOPS(lima_drm_driver_fops); > > /* > * Changelog: > -- > 2.25.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH 0/3] Revert lima fdinfo patchset

2023-04-04 Thread Daniel Vetter
e build clean > or Linus will go bananas ^_^ > > Fwiw for the series: > Acked-by: Emil Velikov Can you (eitehr of you really) please push asap and make sure this doesn't miss the last drm-misc-next pull (-rc6 is this w/e)? Otherwise we'll have a bit a mess. -Daniel > > HTH > -Emil -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 08/10] dma-buf/dma-fence: Introduce long-running completion fences

2023-04-04 Thread Daniel Vetter
> > > > > Then the work function could submit the work and wait for the result. > > > > > > The work item would then pretty much represent what you want, you can > > > wait for it to finish and pass it along as long running dependency. > > > > > > Maybe give it a funky name and wrap it up in a structure, but that's > > > basically it. > > > > > This very much sounds like a i915_sw_fence for the dependency tracking and > > dma_fence_work for the actual work although it's completion fence is a > > dma_fence. > > > > Agree this does sound to i915ish as stated below one of mandates in Xe > was to use the DRM scheduler. Beyond that as someone who a submission > backend in the i915 and Xe, I love how the DRM scheduler works (single > entry point), it makes everything so much easier. > > Matt > > > Although that goes against the whole idea of a condition for merging the xe > > driver would be that we implement some sort of minimal scaffolding for > > long-running workloads in the drm scheduler, and the thinking behind that is > > to avoid implementing intel-specific solutions like those... > > > > Thanks, > > > > Thomas > > > > > > > > > Regards, > > > Christian. > > > > > > > > > > > Thanks, > > > > > > > > Thomas > > > > > > > > > > > > > > > > > > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH v10 11/15] drm/atomic-helper: Set fence deadline for vblank

2023-04-04 Thread Daniel Vetter
dline. > > > > v2: Comment typo fix (danvet) > > v3: If there are multiple CRTCs, consider the time of the soonest vblank > > > > Signed-off-by: Rob Clark > > Reviewed-by: Daniel Vetter > > Signed-off-by: Rob Clark > > --- > > drivers/gpu/dr

Re: [RFC PATCH 00/10] Xe DRM scheduler and long running workload plans

2023-04-04 Thread Daniel Vetter
> >>> > >>> Thomas Hellström (2): > >>> dma-buf/dma-fence: Introduce long-running completion fences > >>> drm/sched: Support long-running sched entities > >>> > >>>drivers/dma-buf/dma-fence.c | 142 +++--- > >>>drivers/dma-buf/dma-resv.c | 5 + > >>>drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 14 +- > >>>drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 +- > >>>drivers/gpu/drm/drm_syncobj.c | 5 +- > >>>drivers/gpu/drm/etnaviv/etnaviv_sched.c | 5 +- > >>>drivers/gpu/drm/lima/lima_sched.c | 5 +- > >>>drivers/gpu/drm/msm/adreno/adreno_device.c | 6 +- > >>>drivers/gpu/drm/msm/msm_ringbuffer.c| 5 +- > >>>drivers/gpu/drm/panfrost/panfrost_job.c | 5 +- > >>>drivers/gpu/drm/scheduler/sched_entity.c| 127 +++-- > >>>drivers/gpu/drm/scheduler/sched_fence.c | 6 +- > >>>drivers/gpu/drm/scheduler/sched_main.c | 278 +++- > >>>drivers/gpu/drm/v3d/v3d_sched.c | 25 +- > >>>include/drm/gpu_scheduler.h | 130 +++-- > >>>include/linux/dma-fence.h | 60 - > >>>16 files changed, 649 insertions(+), 184 deletions(-) > >>> -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 08/10] dma-buf/dma-fence: Introduce long-running completion fences

2023-04-04 Thread Daniel Vetter
-slices these contexts on its own), and we just need a few minimal changes: - allowing the scheduler to ignore the completion fence and just immediately push the next "job" in if its dependencies are ready - maybe minimal amounts of scaffolding to handle the preemption dma_fence beca

Re: [PATCH] fbdev: Don't spam dmesg on bad userspace ioctl input

2023-04-04 Thread Daniel Vetter
On Tue, 4 Apr 2023 at 19:04, Geert Uytterhoeven wrote: > > Hi Daniel, > > On Tue, Apr 4, 2023 at 5:55 PM Daniel Vetter wrote: > > On Tue, 4 Apr 2023 at 16:51, Geert Uytterhoeven > > wrote: > > > On Tue, Apr 4, 2023 at 4:19 PM Daniel Vetter wrote: > >

Re: [PATCH] fbdev: Don't spam dmesg on bad userspace ioctl input

2023-04-04 Thread Daniel Vetter
On Tue, 4 Apr 2023 at 16:51, Geert Uytterhoeven wrote: > > CC linux-fbdev > > On Tue, Apr 4, 2023 at 4:19 PM Daniel Vetter wrote: > > On Tue, Apr 04, 2023 at 03:59:12PM +0200, Daniel Vetter wrote: > > > On Tue, Apr 04, 2023 at 03:53:09PM +0200, Geert Uytterhoeven w

Re: [PATCH] fbdev: Don't spam dmesg on bad userspace ioctl input

2023-04-04 Thread Daniel Vetter
On Tue, Apr 04, 2023 at 03:59:12PM +0200, Daniel Vetter wrote: > On Tue, Apr 04, 2023 at 03:53:09PM +0200, Geert Uytterhoeven wrote: > > Hi Daniel, > > > > CC vkmsdrm maintainer > > > > Thanks for your patch! > > > > On Tue, Apr 4, 2023 at 2:36

Re: [PATCH] fbdev: Don't spam dmesg on bad userspace ioctl input

2023-04-04 Thread Daniel Vetter
On Tue, Apr 04, 2023 at 03:53:09PM +0200, Geert Uytterhoeven wrote: > Hi Daniel, > > CC vkmsdrm maintainer > > Thanks for your patch! > > On Tue, Apr 4, 2023 at 2:36 PM Daniel Vetter wrote: > > There's a few reasons the kernel should not spam dmesg on ba

Re: [PATCH 1/2] drm/hyperv: Add DRM driver for hyperv synthetic video device

2023-04-04 Thread Daniel Vetter
bus_probe, > + .remove = hyperv_vmbus_remove, > + .suspend = hyperv_vmbus_suspend, > + .resume = hyperv_vmbus_resume, > + .driver = { > + .probe_type = PROBE_PREFER_ASYNCHRONOUS, > + }, > +}; > + > +/* -- */ > +/* module init/exit */ > + > +static int __init hyperv_init(void) > +{ > + int ret; > + > + ret = pci_register_driver(_pci_driver); > + if (ret != 0) > + return ret; > + > + return vmbus_driver_register(_hv_driver); > +} > + > +static void __exit hyperv_exit(void) > +{ > + vmbus_driver_unregister(_hv_driver); > + pci_unregister_driver(_pci_driver); > +} > + > +module_init(hyperv_init); > +module_exit(hyperv_exit); > + > +MODULE_DEVICE_TABLE(pci, hyperv_pci_tbl); > +MODULE_DEVICE_TABLE(vmbus, hyperv_vmbus_tbl); > +MODULE_LICENSE("GPL"); > +MODULE_AUTHOR("Deepak Rawat "); > +MODULE_DESCRIPTION("DRM driver for hyperv synthetic video device"); > -- > 2.29.2 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

[PATCH] fbdev: Don't spam dmesg on bad userspace ioctl input

2023-04-04 Thread Daniel Vetter
xes: 6c11df58fd1a ("fbmem: Check virtual screen sizes in fb_set_var()") Cc: Helge Deller Cc: Geert Uytterhoeven Cc: sta...@vger.kernel.org # v5.4+ Cc: Daniel Vetter Cc: Javier Martinez Canillas Cc: Thomas Zimmermann Signed-off-by: Daniel Vetter --- drivers/video/fbdev/core/fbmem.c | 4

Re: [pull] amdgpu, amdkfd, radeon drm-next-6.4

2023-04-03 Thread Daniel Vetter
20 +- > 134 files changed, 119288 insertions(+), 930 deletions(-) > create mode 100644 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.c > create mode 100644 drivers/gpu/drm/amd/amdgpu/gfxhub_v1_2.h > create mode 100644 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c > create mode 100644 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.h > create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.c > create mode 100644 drivers/gpu/drm/amd/amdgpu/nbio_v7_9.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/athub/athub_1_8_0_offset.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/athub/athub_1_8_0_sh_mask.h > create mode 100644 drivers/gpu/drm/amd/include/asic_reg/gc/gc_9_4_3_offset.h > create mode 100644 drivers/gpu/drm/amd/include/asic_reg/gc/gc_9_4_3_sh_mask.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_1_8_0_offset.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/mmhub/mmhub_1_8_0_sh_mask.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_7_9_0_offset.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/nbio/nbio_7_9_0_sh_mask.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/oss/osssys_4_4_2_offset.h > create mode 100644 > drivers/gpu/drm/amd/include/asic_reg/oss/osssys_4_4_2_sh_mask.h > delete mode 100644 drivers/gpu/drm/radeon/radeon_fb.c > create mode 100644 drivers/gpu/drm/radeon/radeon_fbdev.c -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PULL] drm-misc-next

2023-04-03 Thread Daniel Vetter
+- > drivers/gpu/drm/panfrost/panfrost_drv.c| 37 + > drivers/gpu/drm/panfrost/panfrost_gpu.c| 8 ++ > drivers/gpu/drm/scheduler/sched_main.c | 2 +- > drivers/gpu/drm/sun4i/sun4i_backend.c | 2 +- > drivers/gpu/drm/sun4i/sun8i_mixer.c| 2 +- > drivers/gpu/drm/tiny/ofdrm.c | 8 +- > drivers/gpu/drm/tiny/simpledrm.c | 2 +- > drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +- > 54 files changed, 356 insertions(+), 179 deletions(-) > delete mode 100644 > Documentation/devicetree/bindings/display/panel/innolux,p120zdg-bf1.yaml -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

[PULL] drm-fixes for 6.3-rc5

2023-03-30 Thread Daniel Vetter
: Flush lmem contents after construction drm/i915/perf: Drop wakeref on GuC RC error Daniel Vetter (5): Merge tag 'drm-intel-fixes-2023-03-30' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes Merge tag 'amd-drm-fixes-6.3-2023-03-29' of https://gitlab.freedesktop.org

Re: [GIT PULL] etnaviv-fixes for 6.3

2023-03-30 Thread Daniel Vetter
-- > drivers/gpu/drm/etnaviv/etnaviv_gem_prime.c | 10 +- > drivers/gpu/drm/scheduler/sched_main.c | 6 -- > include/drm/gpu_scheduler.h | 7 --- > 4 files changed, 10 insertions(+), 56 deletions(-) > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [pull] amdgpu drm-fixes-6.3

2023-03-30 Thread Daniel Vetter
; > > Tim Huang (1): > drm/amdgpu: allow more APUs to do mode2 reset when go to S4 > > drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c | 7 ++- > 1 file changed, 6 insertions(+), 1 deletion(-) -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PULL] drm-misc-fixes

2023-03-30 Thread Daniel Vetter
ivers/gpu/drm/drm_buddy.c | 4 +- > drivers/gpu/drm/nouveau/nouveau_backlight.c | 7 +- > drivers/gpu/drm/tests/drm_buddy_test.c | 3 +- > 10 files changed, 90 insertions(+), 93 deletions(-) > > -- > Thomas Zimmermann > Graphics Driver Develop

Re: [pull] amdgpu drm-fixes-6.3

2023-03-30 Thread Daniel Vetter
Add DSC Support for Synaptics Cascaded MST Hub > drm/amd/display: Take FEC Overhead into Timeslot Calculation > > .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.c| 51 > ++ > .../amd/display/amdgpu_dm/amdgpu_dm_mst_types.h| 15 +++ > 2 files cha

Re: [PULL] drm-intel-fixes

2023-03-30 Thread Daniel Vetter
drivers/gpu/drm/i915/i915_perf.c | 14 ++-- > drivers/gpu/drm/i915/i915_perf_types.h | 6 ++ > drivers/gpu/drm/i915/i915_pmu.c | 10 +-- > 13 files changed, 177 insertions(+), 42 deletions(-) > > -- > Jani Nikula, Intel Open Source Graphics Center -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [pull] drm: dma-fence-deadline for v6.4

2023-03-29 Thread Daniel Vetter
; include/drm/gpu_scheduler.h | 17 ++ > include/linux/dma-fence.h | 22 > include/linux/dma-resv.h| 2 ++ > include/uapi/linux/sync_file.h | 37 + > 14 files changed, 303 insertions(+), 34 deletions(-) -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [GIT PULL] exynos-drm-next

2023-03-28 Thread Daniel Vetter
drivers/gpu/drm/exynos/exynos_drm_dsi.c| 1813 +--------- > include/drm/bridge/samsung-dsim.h | 115 ++ > 8 files changed, 2191 insertions(+), 1729 deletions(-) > create mode 100644 drivers/gpu/drm/bridge/samsung-dsim.c > create mode 100644 include/drm/bridge/samsung-dsim.h -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [pull] drm: dma-fence-deadline-core for v6.4

2023-03-28 Thread Daniel Vetter
include/drm/gpu_scheduler.h | 17 +++ > include/linux/dma-fence.h | 22 + > include/linux/dma-resv.h| 2 + > include/uapi/drm/drm.h | 17 +++ > include/uapi/linux/sync_file.h | 59 +++- > 19 files changed, 496 insertions(+), 47 deletions(-) -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [GIT PULL FOR v6.4] drm: rcar-du: Miscellaneous fixes and improvements

2023-03-27 Thread Daniel Vetter
drivers/gpu/drm/rcar-du/rcar_lvds.c | 176 > +- > drivers/gpu/drm/rcar-du/rcar_lvds.h | 12 +- > 7 files changed, 163 insertions(+), 111 deletions(-) > > -- > Regards, > > Laurent Pinchart -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

[PULL] drm-fixes for 6.3-rc4

2023-03-24 Thread Daniel Vetter
t;drm/i915/hwmon: Enable PL1 power limit" Badal Nilawar (1): drm/i915/mtl: Disable MC6 for MTL A step Daniel Vetter (3): Merge tag 'drm-misc-fixes-2023-03-23' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes Merge tag 'drm-intel-fixes-2023-03-2

Re: [PULL] drm-intel-next

2023-03-24 Thread Daniel Vetter
gt; include/drm/display/drm_dp.h | 3 + > include/drm/i915_hdcp_interface.h | 539 + > include/drm/i915_mei_hdcp_interface.h | 184 - > 58 files changed, 3322 insertions(+), 1467 deletions(-) > create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc.c > create mode 100644 drivers/gpu/drm/i915/display/intel_hdcp_gsc.h > create mode 100644 drivers/gpu/drm/i915/display/intel_sprite_uapi.c > create mode 100644 drivers/gpu/drm/i915/display/intel_sprite_uapi.h > create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c > create mode 100644 drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h > create mode 100644 include/drm/i915_hdcp_interface.h > delete mode 100644 include/drm/i915_mei_hdcp_interface.h -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PULL] drm-misc-next

2023-03-24 Thread Daniel Vetter
s/gpu/drm/lima/lima_gem.c| 12 +- > drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c| 1 + > drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 11 +- > drivers/gpu/drm/tests/drm_format_helper_test.c | 141 ++--- > drivers/gpu/drm/tiny/bochs.c | 1 - > drivers/gpu/drm/ttm/ttm_bo.c | 3 +- > drivers/gpu/drm/vgem/vgem_drv.h| 11 - > drivers/gpu/drm/vmwgfx/vmwgfx_kms.c| 1 - > include/drm/drm_drv.h | 2 - > include/drm/drm_fb_helper.h| 14 +- > include/drm/drm_mode_config.h | 7 - > 44 files changed, 664 insertions(+), 799 deletions(-) > create mode 100644 drivers/gpu/drm/gma500/fbdev.c -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH] gpu: host1x: fix uninitialized variable use

2023-03-24 Thread Daniel Vetter
On Fri, 24 Mar 2023 at 11:38, Thierry Reding wrote: > > On Fri, Mar 24, 2023 at 10:59:23AM +0100, Daniel Vetter wrote: > > On Fri, 24 Mar 2023 at 10:46, Daniel Vetter wrote: > > > > > > On Wed, Mar 08, 2023 at 05:28:06PM +, Jon Hunter wrote: > > >

Re: [PATCH] gpu: host1x: fix uninitialized variable use

2023-03-24 Thread Daniel Vetter
On Fri, 24 Mar 2023 at 10:46, Daniel Vetter wrote: > > On Wed, Mar 08, 2023 at 05:28:06PM +, Jon Hunter wrote: > > > > > > On 08/03/2023 16:56, Nathan Chancellor wrote: > > > Ping? This warning is now in 6.3-rc1. > > > > Thierry is away at t

Re: [pull] amdgpu drm-fixes-6.3

2023-03-24 Thread Daniel Vetter
9 + > drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 14 > drivers/gpu/drm/amd/amdgpu/nv.c| 2 +- > drivers/gpu/drm/amd/amdgpu/vi.c| 17 + > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 - > drivers/gpu/d

Re: [PATCH] gpu: host1x: fix uninitialized variable use

2023-03-24 Thread Daniel Vetter
; > progress but mainline is now broken because this change got separated > > > from the change it is fixing: > > > > > > https://github.com/ClangBuiltLinux/continuous-integration2/actions/runs/4249931209/jobs/7391912774 > > > https://storage.tuxsuite.com/public/clangbuiltlinux/continuous-integration2/builds/2M7y9HpiXB13qiC2mkHMyeZOcLW/build.log > > > > > > I see this change sitting in the drm-tegra tree [1], which is getting > > > merged into -next, so it is fixed there, which is why we did not notice > > > any issues until the drm-next tree was merged into mainline. Can this be > > > fast tracked to Linus to unbreak clang builds with -Werror? > > > > > > [1]: > > > https://gitlab.freedesktop.org/drm/tegra/-/commit/b9930311641cf2ed905a84aabe27e8f3868aee4a > > -- > nvpublic -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: Linux 6.3-rc3

2023-03-24 Thread Daniel Vetter
idia.com/ > > If that does not come to you through other means before -rc4, could you > just apply it directly so that I can stop applying it to our CI? :) I'll include it in the next drm-fixes pull. -Daniel > > Cheers, > Nathan -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PULL] drm-intel-fixes

2023-03-24 Thread Daniel Vetter
/intel_guc_rc.c | 13 + > drivers/gpu/drm/i915/i915_active.c | 3 +-- > drivers/gpu/drm/i915/i915_hwmon.c | 5 - > drivers/gpu/drm/i915/i915_reg.h| 17 +--- > 13 files changed, 88 insertions(+), 72 deletions(-) > > -- > Jani Nikula, Intel Open Source Graphics Center -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PULL] drm-misc-fixes

2023-03-24 Thread Daniel Vetter
> -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Maxfeldstr. 5, 90409 Nürnberg, Germany > (HRB 36809, AG Nürnberg) > Geschäftsführer: Felix Imendörffer -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH 0/2] docs & checkpatch: allow Closes tags with links

2023-03-17 Thread Daniel Vetter
rfectly fine, but I'm using it > as a very real example of how "Closes:" ends up being very naturally > to mis-use). > > End result: I don't hate our current "Closes:" uses. But I'm very wary of it. > > I'm not at all convinced that it really adds a lot o

Re: [PATCH RFC 10/18] drm/scheduler: Add can_run_job callback

2023-03-16 Thread Daniel Vetter
t;>>>> + continue; > > >>>>> + } > > >>>>> + if (!sched->ops->can_run_job(sched_job)) > > >>>>> + continue; > > >>>>> + } > > >>>>> + > > >>>>> sched_job = drm_sched_entity_pop_job(entity); > > >>>>> > > >>>>> if (!sched_job) { > > >>>>> diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h > > >>>>> index 9db9e5e504ee..bd89ea9507b9 100644 > > >>>>> --- a/include/drm/gpu_scheduler.h > > >>>>> +++ b/include/drm/gpu_scheduler.h > > >>>>> @@ -396,6 +396,14 @@ struct drm_sched_backend_ops { > > >>>>> struct dma_fence *(*prepare_job)(struct drm_sched_job > > >>>>> *sched_job, > > >>>>> struct drm_sched_entity > > >>>>> *s_entity); > > >>>>> > > >>>>> + /** > > >>>>> + * @can_run_job: Called before job execution to check whether > > >>>>> the > > >>>>> + * hardware is free enough to run the job. This can be used to > > >>>>> + * implement more complex hardware resource policies than the > > >>>>> + * hw_submission limit. > > >>>>> + */ > > >>>>> + bool (*can_run_job)(struct drm_sched_job *sched_job); > > >>>>> + > > >>>>> /** > > >>>>> * @run_job: Called to execute the job once all of the > > >>>>> dependencies > > >>>>> * have been resolved. This may be called multiple > > >>>>> times, if > > >>>>> > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [Intel-gfx] [RFC PATCH 00/20] Initial Xe driver submission

2023-03-09 Thread Daniel Vetter
On Thu, 2 Mar 2023 at 00:00, Rodrigo Vivi wrote: > On Fri, Feb 17, 2023 at 09:51:37PM +0100, Daniel Vetter wrote: > > Hi all, > > > > [I thought I've sent this out earlier this week, but alas got stuck, kinda > > bad timing now since I'm out next week but oh wel

Re: [PATCH v2] drm/virtio: Add option to disable KMS support

2023-02-27 Thread Daniel Vetter
0 +249,12 @@ int virtio_gpu_init(struct virtio_device *vdev, struct > drm_device *dev) > virtio_gpu_get_capsets(vgdev, num_capsets); > if (vgdev->has_edid) > virtio_gpu_cmd_get_edids(vgdev); > - virtio_gpu_cmd_get_display_info(vgdev); > - virtio_gpu_notify(vgdev); > - wait_event_timeout(vgdev->resp_wq, !vgdev->display_info_pending, > -5 * HZ); > + if (IS_ENABLED(CONFIG_DRM_VIRTIO_GPU_KMS)) { > + virtio_gpu_cmd_get_display_info(vgdev); > + virtio_gpu_notify(vgdev); > + wait_event_timeout(vgdev->resp_wq, !vgdev->display_info_pending, > +5 * HZ); > + } > return 0; > > err_scanouts: > -- > 2.39.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC PATCH 00/20] Initial Xe driver submission

2023-02-17 Thread Daniel Vetter
include/drm/drm_suballoc.h | 112 ++ > include/drm/gpu_scheduler.h | 41 ++- > sound/hda/hdac_i915.c | 17 +- > sound/pci/hda/hda_intel.c | 56 +-- > sound/soc/intel/avs/core.c| 13 +- > sound/soc/sof/intel/hda.c | 7 +- > 98 files changed, 2076 insertions(+), 1325 deletions(-) > create mode 100644 drivers/gpu/drm/drm_pt_walk.c > create mode 100644 drivers/gpu/drm/drm_suballoc.c > create mode 100644 include/drm/drm_pt_walk.h > create mode 100644 include/drm/drm_suballoc.h > > -- > 2.37.3 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH v2 2/2] drm: document DRM_IOCTL_PRIME_HANDLE_TO_FD and PRIME_FD_TO_HANDLE

2023-02-17 Thread Daniel Vetter
On Fri, Feb 17, 2023 at 04:22:04PM +, Simon Ser wrote: > v2: mention caps, note that the IOCTLs might fail, document that > user-space needs a data structure to keep track of the > handles (Daniel V.) > > Signed-off-by: Simon Ser > Cc: Daniel Vetter > Cc: Pekka Paalane

Re: [PATCH] drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()

2023-02-17 Thread Daniel Vetter
On Fri, Feb 17, 2023 at 09:18:54AM +0100, Thomas Zimmermann wrote: > Hi > > Am 16.02.23 um 21:11 schrieb Daniel Vetter: > > On Thu, Feb 16, 2023 at 03:06:20PM +0100, Thomas Zimmermann wrote: > > > Move drm_fb_helper_unprepare() from drm_fb_helper_fini() into the > >

[PATCH] drm/fb-helper: Try to protect cleanup against delayed setup

2023-02-17 Thread Daniel Vetter
lly butchered, and CI complained about lockdep splats. So limit the critical section again and just add a few notes what the proper fix is. References: https://intel-gfx-ci.01.org/tree/linux-next/next-20201215/fi-byt-j1900/igt@i915_pm_...@module-reload.html Signed-off-by: Daniel Vetter Cc: Vi

Re: [PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex

2023-02-17 Thread Daniel Vetter
t one who argued this is a good thing to have. kernfs/kobj/sysfs people spend endless amounts of engineer on trying to build something that's impossible to get wrong, or at least get as close to that as feasible. I mean the entire rust endeavour flies under that flag too. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex

2023-02-17 Thread Daniel Vetter
On Fri, Feb 17, 2023 at 11:01:18AM +0100, Stanislaw Gruszka wrote: > On Fri, Feb 17, 2023 at 10:22:25AM +0100, Christian König wrote: > > Am 16.02.23 um 20:54 schrieb Daniel Vetter: > > > On Thu, Feb 16, 2023 at 07:08:49PM +0200, Jani Nikula wrote: > > > > On Thu

Re: [PATCH 1/2] drm/client: fix circular reference counting issue

2023-02-17 Thread Daniel Vetter
On Fri, 17 Feb 2023 at 13:06, Christian König wrote: > > Am 16.02.23 um 15:34 schrieb Daniel Vetter: > > On Thu, Jan 26, 2023 at 03:30:31PM +0100, Thomas Zimmermann wrote: > >> Hi > >> > >> Am 26.01.23 um 11:28 schrieb Christian König: > >>> We

Re: [PATCH v4 2/2] gpu/drm/panel: Add Sony TD4353 JDI panel driver

2023-02-17 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 09:37:51PM +0100, Sam Ravnborg wrote: > On Thu, Feb 16, 2023 at 01:49:23PM +0100, Daniel Vetter wrote: > > On Thu, 16 Feb 2023 at 13:47, Neil Armstrong > > wrote: > > > > > > On 16/02/2023 13:32, Daniel Vetter wrote: > > > >

Re: [PATCH v10 00/11] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2023-02-16 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 11:43:38PM +0300, Dmitry Osipenko wrote: > On 2/16/23 15:15, Daniel Vetter wrote: > > On Mon, Jan 30, 2023 at 03:02:10PM +0300, Dmitry Osipenko wrote: > >> On 1/27/23 11:13, Gerd Hoffmann wrote: > >>> On Thu, Jan 26, 2023 at 01:55:09A

Re: [PATCH 0/1] drm: Add a gpu page-table walker

2023-02-16 Thread Daniel Vetter
drivers/gpu/drm/drm_pt_walk.c > create mode 100644 include/drm/drm_pt_walk.h > > -- > 2.34.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH] drm/fb-helper: Remove drm_fb_helper_unprepare() from drm_fb_helper_fini()

2023-02-16 Thread Daniel Vetter
_helper_unprepare()") > Cc: Thomas Zimmermann > Cc: Javier Martinez Canillas > Cc: Maarten Lankhorst > Cc: Maxime Ripard > Cc: David Airlie > Cc: Daniel Vetter > Cc: dri-devel@lists.freedesktop.org > > Signed-off-by: Thomas Zimmermann This reminds me of a

Re: Try to address the drm_debugfs issues

2023-02-16 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 05:31:50PM +0100, Christian König wrote: > > > Am 16.02.23 um 12:34 schrieb Daniel Vetter: > > On Thu, Feb 09, 2023 at 03:06:10PM +0100, Christian König wrote: > > > Am 09.02.23 um 14:06 schrieb Maíra Canal: > > > > On 2/9/23 09:13,

Re: [PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex

2023-02-16 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 07:06:46PM +0200, Jani Nikula wrote: > On Thu, 16 Feb 2023, Stanislaw Gruszka > wrote: > > On Thu, Feb 16, 2023 at 12:33:08PM +0100, Daniel Vetter wrote: > >> On Thu, Feb 09, 2023 at 09:18:38AM +0100, Christian König wrote: > >> > T

Re: [PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex

2023-02-16 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 07:08:49PM +0200, Jani Nikula wrote: > On Thu, 16 Feb 2023, Christian König wrote: > > Am 16.02.23 um 17:46 schrieb Jani Nikula: > >> On Thu, 16 Feb 2023, Christian König wrote: > >>> Am 16.02.23 um 12:33 schrieb Daniel Vetter: > >&g

Re: [PATCH 2/2] drm: document DRM_IOCTL_GEM_CLOSE

2023-02-16 Thread Daniel Vetter
; > [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110 > > Signed-off-by: Simon Ser > Cc: Daniel Vetter > Cc: Pekka Paalanen > Cc: Daniel Stone > --- > include/uapi/drm/drm.h | 13 + > 1 file changed, 13 insertions(+) > > diff --git a

Re: [PATCH 1/2] drm: document DRM_IOCTL_PRIME_HANDLE_TO_FD and PRIME_FD_TO_HANDLE

2023-02-16 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 01:09:41PM +, Simon Ser wrote: > Signed-off-by: Simon Ser > Cc: Daniel Vetter > Cc: Pekka Paalanen > Cc: Daniel Stone > --- > include/uapi/drm/drm.h | 17 + > 1 file changed, 17 insertions(+) > > diff --git a/include/ua

Re: [PATCH 1/2] drm/client: fix circular reference counting issue

2023-02-16 Thread Daniel Vetter
lding references to the GEM object to prevent its destruction. > > +*/ > > + drm_mode_destroy_dumb(client->dev, handle, client->file); > > + > > if (ret) { > > drm_client_buffer_delete(buffer); > > return ERR_PTR(ret); > > diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h > > index 39482527a775..b5acdab73766 100644 > > --- a/include/drm/drm_client.h > > +++ b/include/drm/drm_client.h > > @@ -134,11 +134,6 @@ struct drm_client_buffer { > > */ > > struct drm_client_dev *client; > > - /** > > -* @handle: Buffer handle > > -*/ > > - u32 handle; > > - > > /** > > * @pitch: Buffer pitch > > */ > > -- > Thomas Zimmermann > Graphics Driver Developer > SUSE Software Solutions Germany GmbH > Maxfeldstr. 5, 90409 Nürnberg, Germany > (HRB 36809, AG Nürnberg) > Geschäftsführer: Ivo Totev -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH v4 2/2] gpu/drm/panel: Add Sony TD4353 JDI panel driver

2023-02-16 Thread Daniel Vetter
On Thu, 16 Feb 2023 at 13:47, Neil Armstrong wrote: > > On 16/02/2023 13:32, Daniel Vetter wrote: > > On Thu, 16 Feb 2023 at 12:59, Konrad Dybcio > > wrote: > >> > >> > >> > >> On 19.01.2023 17:32, Konrad Dybcio wrote: > >>> Fr

Re: [PATCH] drm: document expectations for GETFB2 handles

2023-02-16 Thread Daniel Vetter
positor supposed to do transition animation > > from an old FB to its own thing? I guess mmap + glTexImage2D equivalent > > to make a copy of the old FB so one can use it as a texture? > > I think the compositor can export the handle as DMA-BUF, then close the > handle imm

Re: [PATCH v4 2/2] gpu/drm/panel: Add Sony TD4353 JDI panel driver

2023-02-16 Thread Daniel Vetter
err_probe(dev, ret, "Failed to get regulators\n"); > > + > > + ctx->panel_reset_gpio = devm_gpiod_get(dev, "panel-reset", > > GPIOD_ASIS); > > + if (IS_ERR(ctx->panel_reset_gpio)) > > + return dev_err_probe(dev, PTR_ERR(ctx->panel_reset_gpio), > > + "Failed to get panel-reset-gpios\n"); > > + > > + ctx->touch_reset_gpio = devm_gpiod_get(dev, "touch-reset", > > GPIOD_ASIS); > > + if (IS_ERR(ctx->touch_reset_gpio)) > > + return dev_err_probe(dev, PTR_ERR(ctx->touch_reset_gpio), > > + "Failed to get touch-reset-gpios\n"); > > + > > + ctx->dsi = dsi; > > + mipi_dsi_set_drvdata(dsi, ctx); > > + > > + dsi->lanes = 4; > > + dsi->format = MIPI_DSI_FMT_RGB888; > > + dsi->mode_flags = MIPI_DSI_CLOCK_NON_CONTINUOUS; > > + > > + drm_panel_init(>panel, dev, _td4353_jdi_panel_funcs, > > +DRM_MODE_CONNECTOR_DSI); > > + > > + ret = drm_panel_of_backlight(>panel); > > + if (ret) > > + return dev_err_probe(dev, ret, "Failed to get backlight\n"); > > + > > + drm_panel_add(>panel); > > + > > + ret = mipi_dsi_attach(dsi); > > + if (ret < 0) { > > + dev_err(dev, "Failed to attach to DSI host: %d\n", ret); > > + drm_panel_remove(>panel); > > + return ret; > > + } > > + > > + return 0; > > +} > > + > > +static void sony_td4353_jdi_remove(struct mipi_dsi_device *dsi) > > +{ > > + struct sony_td4353_jdi *ctx = mipi_dsi_get_drvdata(dsi); > > + int ret; > > + > > + ret = mipi_dsi_detach(dsi); > > + if (ret < 0) > > + dev_err(>dev, "Failed to detach from DSI host: %d\n", > > ret); > > + > > + drm_panel_remove(>panel); > > +} > > + > > +static const struct of_device_id sony_td4353_jdi_of_match[] = { > > + { .compatible = "sony,td4353-jdi-tama", .data = (void > > *)TYPE_TAMA_60HZ }, > > + { /* sentinel */ } > > +}; > > +MODULE_DEVICE_TABLE(of, sony_td4353_jdi_of_match); > > + > > +static struct mipi_dsi_driver sony_td4353_jdi_driver = { > > + .probe = sony_td4353_jdi_probe, > > + .remove = sony_td4353_jdi_remove, > > + .driver = { > > + .name = "panel-sony-td4353-jdi", > > + .of_match_table = sony_td4353_jdi_of_match, > > + }, > > +}; > > +module_mipi_dsi_driver(sony_td4353_jdi_driver); > > + > > +MODULE_AUTHOR("Konrad Dybcio "); > > +MODULE_DESCRIPTION("DRM panel driver for SONY Xperia XZ2/XZ2c JDI panel"); > > +MODULE_LICENSE("GPL"); -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH 1/6] drm/amdgpu: Generalize KFD dmabuf import

2023-02-16 Thread Daniel Vetter
that it should be a problem for drivers and not for DRM core. > > I was going to re-send the [1], but other things were getting priority. > It's good that you reminded me about it :) I may re-send it sometime > soon if there are no new objections. > > [1] https://patchwork.freedesktop.org/patch/487481/ > > [2] > https://lore.kernel.org/all/20220701090240.1896131-1-dmitry.osipe...@collabora.com/ Hm I still don't like allowing this in general, because in general it just doesn't work. I think more like a per-driver opt-in or something might be needed, so that drivers which "know" that it's ok to just mmap without coherency can allow that. Allowing this in general essentially gives up on the entire idea of dma-buf cache flushing completely. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH v10 00/11] Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers

2023-02-16 Thread Daniel Vetter
DRM core changes. I expect he'll ack them. > > Thank you for reviewing the virtio patches! I think best-case would be an ack from msm people that this looks good (even better a conversion for msm to start using this). Otherwise I think the locking looks reasonable, I think the tricky bits ha

Re: [PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex

2023-02-16 Thread Daniel Vetter
On Thu, Feb 16, 2023 at 12:33:08PM +0100, Daniel Vetter wrote: > On Thu, Feb 09, 2023 at 09:18:38AM +0100, Christian König wrote: > > The mutex was completely pointless in the first place since any > > parallel adding of files to this list would result in random > > be

Re: Try to address the drm_debugfs issues

2023-02-16 Thread Daniel Vetter
; for vc4 and vkms. > > > > > > Thanks for the feedback and yes that's exactly what I meant with > > > that I haven't looked into all code paths. > > > > > > Could it be that v3d registers it's debugfs files from the > > > debugfs_init callback? > > > > Although this is true, I'm not sure if this is the reason why the files > > are > > being registered twice, as this doesn't happen to vc4, and it also uses > > the > > debugfs_init callback. I believe it is somewhat related to the fact that > > v3d is the primary node and the render node. > > I see. Thanks for the hint. > > > > > Best Regards, > > - Maíra Canal > > > > > > > > One alternative would be to just completely nuke support for > > > separate render node debugfs files and only add a symlink to the > > > primary node. Opinions? > > What do you think of this approach? I can't come up with any reason why we > should have separate debugfs files for render nodes and I think it is pretty > much the same reason you came up with the patch for per device debugfs files > instead of per minor. Yeah I think best is to symlink around a bit for compat. I thought we where doing that already, and you can't actually create debugfs files on render nodes? Or did I only dream about this? -Daniel > > Regards, > Christian. > > > > > > > Regards, > > > Christian. > > > > > > > > > > > Otherwise, the patchset looks good to me, but maybe Daniel has > > > > some other > > > > thoughts about it. > > > > > > > > Best Regards, > > > > - Maíra Canal > > > > > > > > > > > > > > Please comment/discuss. > > > > > > > > > > Cheers, > > > > > Christian. > > > > > > > > > > > > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex

2023-02-16 Thread Daniel Vetter
; @@ -311,21 +311,6 @@ struct drm_device { >*/ > struct drm_fb_helper *fb_helper; > > - /** > - * @debugfs_mutex: > - * > - * Protects _list access. > - */ > - struct mutex debugfs_mutex; > - > - /** > - * @debugfs_list: > - * > - * List of debugfs files to be created by the DRM device. The files > - * must be added during drm_dev_register(). > - */ > - struct list_head debugfs_list; > - > /* Everything below here is for legacy driver, never use! */ > /* private: */ > #if IS_ENABLED(CONFIG_DRM_LEGACY) > -- > 2.34.1 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch

Re: [RFC v3 0/9] Waitboost drm syncobj waits

2023-02-16 Thread Daniel Vetter
intel_breadcrumbs.c | 22 > drivers/gpu/drm/i915/gt/intel_engine_pm.c | 1 - > drivers/gpu/drm/i915/i915_active.c | 2 +- > drivers/gpu/drm/i915/i915_active.h | 2 +- > drivers/gpu/drm/i915/i915_request.c | 13 +- > drivers/gpu/drm/vmwgfx/vmwgfx_fence.c

<    1   2   3   4   5   6   7   8   9   10   >