- Oct 23, 2018
-
-
Lyude Paul authored
Some drivers, nouveau in particular, need to perform some hardware setup before enabling the MST topology. Ideally, we want this setup to always be done whenever topologies are enabled or disabled, even if it's not because the driver choose to change the topology state. So, add some hooks that get called under the main MST topology manager's lock and implement said hooks in nouveau. TODO: test this works
-
Lyude Paul authored
Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
Currently we set mgr->mst_state in drm_dp_mst_topology_mgr_set_mst() before we have actually performed any operations that could fail, meaning that mgr->mst_state will get set even if we fail to setup the topology. Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
We already check the DPCD in nv50_mstm_detect(), and we also want to be able to call this without having to read the DPCD. Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
Seeing as this is not a structure drivers are ever supposed to be modifying or looking at anyway, we shouldn't be exposing it to drivers because then people will think you are supposed to touch it. Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
Investigation done, it's NULL because you didn't grab connection_mutex, which you need to modify anything within your drm connector structures. WIP FIXME: test this? probably make amd test this Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
Same as the previous commit, but for nv50_mstc_detect() this time. Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: stable@vger.kernel.org
-
Lyude Paul authored
mstc->port isn't validated here so it could be null or worse when we access it. And drivers aren't ever supposed to be looking at it's contents anyway. Plus, we can already get the MST manager from &mstc->mstm->mgr. Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: stable@vger.kernel.org
-
Lyude Paul authored
Currently, nouveau tries to go through the drm_dp_mst_port structures itself in order to retrieve the relevant payload and VCPI information that it needs to report to the GPU. This is wrong: mstc->port could be destroyed at any point, and additionally the payload could be changed at any point because it doesn't bother trying to grab the payload lock. So; remove nv50_msto_payload entirely and use the new drm_dp_get_payload_info() helper. Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
Some hardware (nvidia hardware in particular) needs to be notified of the exact VCPI and payload settings that the topology manager decided on for each mstb port. Since there isn't currently any way to get this information without going through port (which drivers are very much not supposed to do by themselves, ever), let's add one. Signed-off-by:
Lyude Paul <lyude@redhat.com>
-
Lyude Paul authored
Currently, nouveau uses the yolo method of setting up MST displays: it uses the old VCPI helpers (drm_dp_find_vcpi_slots()) for computing the display configuration. These helpers don't take care to make sure they take a reference to the mstb port that they're checking, and additionally don't actually check whether or not the topology still has enough bandwidth to provide the VCPI tokens required. So, drop usage of the old helpers and move entirely over to the atomic helpers. Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
-
Lyude Paul authored
It occurred to me that we never actually check this! So let's start doing that. Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
-
Lyude Paul authored
There has been a TODO waiting for quite a long time in drm_dp_mst_topology.c: /* We cannot rely on port->vcpi.num_slots to update * topology_state->avail_slots as the port may not exist if the parent * branch device was unplugged. This should be fixed by tracking * per-port slot allocation in drm_dp_mst_topology_state instead of * depending on the caller to tell us how many slots to release. */ That's not the only reason we should fix this: forcing the driver to track the VCPI allocations throughout a state's atomic check is error prone, because it means that extra care has to be taken with the order that drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() are called in in order to ensure idempotency. Currently the only driver actually using these helpers, i915, doesn't even do this correctly: multiple ->best_encoder() checks with i915's current implementation would not be idempotent and would over-allocate VCPI slots, something I learned trying to implement fallback retraining in MST. So: simplify this whole mess, and teach drm_dp_atomic_find_vcpi_slots() and drm_dp_atomic_release_vcpi_slots() to track the VCPI allocations for each port. This allows us to ensure idempotency without having to rely on the driver as much. Additionally: the driver doesn't need to do any kind of VCPI slot tracking anymore if it doesn't need it for it's own internal state. Additionally; this moves the code for checking whether or not the VCPI allocations in the atomic state are valid into the new ->atomic_check() hook for private objects, so we can ensure that we only check the final VCPI allocation that would be incurred by the new state and not the mid-check VCPI allocations. This prevents us from failing checks which end up allocating VCPI slots to ports before freeing any of the VCPI slots allocated by ports which are about to be disabled. Also: update the documentation and make it more obvious that these /must/ be called by /all/ atomic drivers supporting MST. Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
-
Lyude Paul authored
Currently; private objects are mostly used just for driver-specific atomic state, but not entirely. MST also uses private objects for holding it's atomic state, but in order to make our MST helpers safer for atomic we need to be able to check that state after the driver has performed it's own checks on the atomic state. So, add an optional ->atomic_check() callback into drm_private_state_funcs that gets called after the driver's atomic checks. Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
-
Lyude Paul authored
There's no reason to track the atomic state three times. Unfortunately, this is currently what we're doing, and even worse is that there is only one actually correct state pointer: the one in mst_state->base.state. mgr->state never seems to be used, along with the one in mst_state->state. This confused me for over 4 hours until I realized there was no magic behind these pointers. So, let's save everyone else from the trouble. Signed-off-by:
Lyude Paul <lyude@redhat.com>.> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
-
Lyude Paul authored
No functional changes Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
-
- Oct 18, 2018
-
-
Lyude Paul authored
No functional changes Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel@ffwll.ch>
-
Lyude Paul authored
Because we have drm_dp_atomic_find_vcpi_slots(), which actually takes care to update the atomic state of the MST topology, prints valuable debugging output, and actually takes references to the ports it's checking! This explains some incorrect usage I've been seeing across the tree... Signed-off-by:
Lyude Paul <lyude@redhat.com> Cc: Daniel Vetter <daniel@ffwll.ch>
-
Ville Syrjälä authored
-
Ville Syrjälä authored
# Conflicts: # kernel/events/core.c
-
Ville Syrjälä authored
-
Ville Syrjälä authored
# Conflicts: # drivers/gpu/drm/i915/i915_debugfs.c # drivers/gpu/drm/i915/i915_irq.c # drivers/gpu/drm/i915/intel_csr.c # drivers/gpu/drm/i915/intel_display.c # drivers/gpu/drm/i915/intel_dp_mst.c # drivers/gpu/drm/i915/intel_drv.h
-
Ville Syrjälä authored
# Conflicts: # drivers/gpu/drm/drm_syncobj.c
-
Ville Syrjälä authored
-
Ville Syrjälä authored
-
Ville Syrjälä authored
-
Ville Syrjälä authored
-
Ville Syrjälä authored
Replace the kvmalloc_array() with i915_gem_object_get_dma_address() when populating rotated vmas. One random access mechanism ought to be enough for everyone? To calculate the size of the radix tree I think we can do something like this (assuming 64bit pointers): num_pages = obj_size / 4096 tree_height = ceil(log64(num_pages)) num_nodes = sum(64^n, n, 0, tree_height-1) tree_size = num_nodes * 576 If we compare that with the object size we should get a relative overhead of around .2% to 1% for reasonable sized objects, which framebuffers tend to be. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Suggested-by:
Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by:
Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181016150413.11577-1-ville.syrjala@linux.intel.com Reviewed-by:
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
-
Joonas Lahtinen authored
Use single exit point to drop rpm wakeref in case of an error. Fixes: 9d3eb2c3 ("drm/i915: Hold rpm wakeref for debugfs/i915_drop_caches_set") Signed-off-by:
Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by:
Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20181018092025.24076-1-joonas.lahtinen@linux.intel.com
-
The test requires driver tweaks to avoid causing error messages on intentionally-triggered errors and to stop accessing non existing register. However, this is a pure GuC FW interface test and should be covered by FW validation, so it isn't really worth tweaking the driver for it and we're better off dropping it instead. Testing the driver running out of doorbells is already covered by igt_guc_doorbells Suggested-by:
Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by:
Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by:
Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by:
Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20181018004610.22895-1-daniele.ceraolospurio@intel.com
-
Jani Nikula authored
intel_dsi_vbt_init() has grown too unwieldy, and it's about to be modified due to ICL DSI. Abstract out the VLV specific dphy param init. No functional changes. Intentionally no stylistic changes during code movement. Cc: Madhav Chauhan <madhav.chauhan@intel.com> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Reviewed-by:
Madhav Chauhan <madhav.chauhan@intel.com> Signed-off-by:
Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/96d15760db027a137f298ec330520ef8ec6474b0.1539613303.git.jani.nikula@intel.com
-
Jani Nikula authored
Abstract bitrate calculation to a newly resurrected intel_dsi.c file that will contain common code for VLV and ICL DSI. No functional changes. Cc: Madhav Chauhan <madhav.chauhan@intel.com> Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Reviewed-by:
Madhav Chauhan <madhav.chauhan@intel.com> Signed-off-by:
Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/100e9721dfdec4f3987549ef24291bafc9cb0517.1539613303.git.jani.nikula@intel.com
-
Jani Nikula authored
Encoders are not alike, make enable and disable hooks optional like other hooks. Utilize this in DSI code, and remove the silly nop hook. v2: Add the check also to intel_sanitize_encoder() (Madhav) Reviewed-by:
Madhav Chauhan <madhav.chauhan@intel.com> Acked-by:
Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by:
Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181016124134.10257-1-jani.nikula@intel.com
-
The DMA API does its own zone decisions based on the coherent_dma_mask. Signed-off-by:
Christoph Hellwig <hch@lst.de> Reviewed-by:
Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20181013151707.32210-7-hch@lst.de
-
Benjamin Gaignard authored
Wait until the next vblank to be sure that crtc has been disabled. Signed-off-by:
Benjamin Gaignard <benjamin.gaignard@linaro.org> Reviewed-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20181012094639.1585-1-benjamin.gaignard@linaro.org
-
Chunming Zhou authored
This patch is for VK_KHR_timeline_semaphore extension, semaphore is called syncobj in kernel side: This extension introduces a new type of syncobj that has an integer payload identifying a point in a timeline. Such timeline syncobjs support the following operations: * CPU query - A host operation that allows querying the payload of the timeline syncobj. * CPU wait - A host operation that allows a blocking wait for a timeline syncobj to reach a specified value. * Device wait - A device operation that allows waiting for a timeline syncobj to reach a specified value. * Device signal - A device operation that allows advancing the timeline syncobj to a specified value. v1: Since it's a timeline, that means the front time point(PT) always is signaled before the late PT. a. signal PT design: Signal PT fence N depends on PT[N-1] fence and signal opertion fence, when PT[N] fence is signaled, the timeline will increase to value of PT[N]. b. wait PT design: Wait PT fence is signaled by reaching timeline point value, when timeline is increasing, will compare wait PTs value with new timeline value, if PT value is lower than timeline value, then wait PT will be signaled, otherwise keep in list. syncobj wait operation can wait on any point of timeline, so need a RB tree to order them. And wait PT could ahead of signal PT, we need a sumission fence to perform that. v2: 1. remove unused DRM_SYNCOBJ_CREATE_TYPE_NORMAL. (Christian) 2. move unexposed denitions to .c file. (Daniel Vetter) 3. split up the change to drm_syncobj_find_fence() in a separate patch. (Christian) 4. split up the change to drm_syncobj_replace_fence() in a separate patch. 5. drop the submission_fence implementation and instead use wait_event() for that. (Christian) 6. WARN_ON(point != 0) for NORMAL type syncobj case. (Daniel Vetter) v3: 1. replace normal syncobj with timeline implemenation. (Vetter and Christian) a. normal syncobj signal op will create a signal PT to tail of signal pt list. b. normal syncobj wait op will create a wait pt with last signal point, and this wait PT is only signaled by related signal point PT. 2. many bug fix and clean up 3. stub fence moving is moved to other patch. v4: 1. fix RB tree loop with while(node=rb_first(...)). (Christian) 2. fix syncobj lifecycle. (Christian) 3. only enable_signaling when there is wait_pt. (Christian) 4. fix timeline path issues. 5. write a timeline test in libdrm v5: (Christian) 1. semaphore is called syncobj in kernel side. 2. don't need 'timeline' characters in some function name. 3. keep syncobj cb. v6: (Christian) 1. merge syncobj_timeline to syncobj structure. 2. simplify some check sentences. 3. some misc change. 4. fix CTS failed issue. v7: (Christian) 1. error handling when creating signal pt. 2. remove timeline naming in func. 3. export flags in find_fence. 4. allow reset timeline. v8: 1. use wait_event_interruptible without timeout 2. rename _TYPE_INDIVIDUAL to _TYPE_BINARY v9: 1. rename signal_pt->base to signal_pt->fence_array to avoid misleading 2. improve kerneldoc individual syncobj is tested by ./deqp-vk -n dEQP-VK*semaphore* timeline syncobj is tested by ./amdgpu_test -s 9 Signed-off-by:
Chunming Zhou <david1.zhou@amd.com> Signed-off-by:
Christian König <christian.koenig@amd.com> Cc: Christian Konig <christian.koenig@amd.com> Cc: Dave Airlie <airlied@redhat.com> Cc: Daniel Rakos <Daniel.Rakos@amd.com> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Cc: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by:
Christian König <christian.koenig@amd.com> Acked-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/257258/
-
Jani Nikula authored
Pass the type we want to simplify. No functional changes. v2: s/dev_priv/i915/g (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by:
Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by:
Jani Nikula <jani.nikula@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181017093539.5468-1-jani.nikula@intel.com
-
In response for I915_PARAM_HAS_HUC we are returning value that indicates if HuC firmware was loaded and verified. However, our previously used positive value was based on specific register bit which is about to change on future platform. Let's normalize our return values to 0 and 1 before clients will start to use Gen9 value. v2: use bool for implicit conversion (Chris) Signed-off-by:
Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Michal Winiarski <michal.winiarski@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Haihao Xiang <haihao.xiang@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> #1 Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by:
Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20181017195245.39644-1-michal.wajdeczko@intel.com
-
Tvrtko Ursulin authored
GEM_WARN_ON currently has dangerous semantics where it is completely compiled out on !GEM_DEBUG builds. This can leave users who expect it to be more like a WARN_ON, just without a warning in non-debug builds, in complete ignorance. Another gotcha with it is that it cannot be used as a statement. Which is again different from a standard kernel WARN_ON. This patch fixes both problems by making it behave as one would expect. It can now be used both as an expression and as statement, and also the condition evaluates properly in all builds - code under the conditional will therefore not unexpectedly disappear. To satisfy call sites which really want the code under the conditional to completely disappear, we add GEM_DEBUG_WARN_ON and convert some of the callers to it. This one can also be used as both expression and statement. >From the above it follows GEM_DEBUG_WARN_ON should be used in situations where we are certain the condition will be hit during development, but at a place in code where error can be handled to the benefit of not crashing the machine. GEM_WARN_ON on the other hand should be used where condition may happen in production and we just want to distinguish the level of debugging output emitted between the production and debug build. v2: * Dropped BUG_ON hunk. Signed-off-by:
Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Cc: Tomasz Lis <tomasz.lis@intel.com> Reviewed-by:
Tomasz Lis <tomasz.lis@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181012063142.16080-1-tvrtko.ursulin@linux.intel.com
-
Add missing MODULE_FIRMWARE while loading DMC ICL. v2: Add Fixes tag. (Rodrigo) v3: Rebase by Rodrigo after commit 7fe78985 ("drm/i915/csr: restructure CSR firmware definition macros") v4: Rodrigo fixing his own mess on commit mentioning on v3 comment above. Fixes: 4445930f ("firmware/dmc/icl: load v1.07 on icelake.") Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Jani Nikula <jani.nikula@intel.com> Signed-off-by:
Anusha Srivatsa <anusha.srivatsa@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> (v2) Signed-off-by:
Rodrigo Vivi <rodrigo.vivi@intel.com> Tested-by:
Paulo Zanoni <paulo.r.zanoni@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20181004223613.19938-1-rodrigo.vivi@intel.com (cherry picked from commit 00e5d8b1) Signed-off-by:
Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
-