Bifrost devices do support the flush reduction feature, so on first job
submit we were trying to read the register while still powered off.
If the GPU is powered off, the feature doesn't bring any benefit, so
don't try to read.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso(a)collabora.com>
---
drivers/gpu/drm/panfrost/panfrost_gpu.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/panfrost/panfrost_gpu.c b/drivers/gpu/drm/panfrost/…
[View More]panfrost_gpu.c
index f2c1ddc41a9b..e0f190e43813 100644
--- a/drivers/gpu/drm/panfrost/panfrost_gpu.c
+++ b/drivers/gpu/drm/panfrost/panfrost_gpu.c
@@ -10,6 +10,7 @@
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
#include "panfrost_device.h"
#include "panfrost_features.h"
@@ -368,7 +369,16 @@ void panfrost_gpu_fini(struct panfrost_device *pfdev)
u32 panfrost_gpu_get_latest_flush_id(struct panfrost_device *pfdev)
{
- if (panfrost_has_hw_feature(pfdev, HW_FEATURE_FLUSH_REDUCTION))
- return gpu_read(pfdev, GPU_LATEST_FLUSH_ID);
+ u32 flush_id;
+
+ if (panfrost_has_hw_feature(pfdev, HW_FEATURE_FLUSH_REDUCTION)) {
+ /* Flush reduction only makes sense when the GPU is kept powered on between jobs */
+ if (pm_runtime_get_if_in_use(pfdev->dev)) {
+ flush_id = gpu_read(pfdev, GPU_LATEST_FLUSH_ID);
+ pm_runtime_put(pfdev->dev);
+ return flush_id;
+ }
+ }
+
return 0;
}
--
2.21.0
[View Less]
Add support to capture the drm atomic state snapshot which
can then be wired up with the devcoredump of the relevant display
errors to give useful information to debug the issues.
Since the devcoredump is read by usermode and it is allowed
upto 5 minutes to read the coredump, capturing the snapshot that
time will not result in an accurate result.
Rather we should capture the snapshot right after the error
happened. Hence add support for capturing this snapshot by
re-using the …
[View More]drm_atomic_helper_duplicate_state() API to support
a non-context version.
Also add nolock versions of the drm_atomic_get_***_state() APIs
which can be used to get snapshot of the drm atomic state of
display drivers.
Signed-off-by: Abhinav Kumar <abhinavk(a)codeaurora.org>
---
drivers/gpu/drm/drm_atomic.c | 154 ++++++++++++++++++----------
drivers/gpu/drm/drm_atomic_helper.c | 28 ++++-
include/drm/drm_atomic.h | 10 ++
include/drm/drm_atomic_helper.h | 2 +
4 files changed, 136 insertions(+), 58 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
index 9ccfbf213d72..4e805157100b 100644
--- a/drivers/gpu/drm/drm_atomic.c
+++ b/drivers/gpu/drm/drm_atomic.c
@@ -272,37 +272,23 @@ void __drm_atomic_state_free(struct kref *ref)
}
EXPORT_SYMBOL(__drm_atomic_state_free);
-/**
- * drm_atomic_get_crtc_state - get CRTC state
- * @state: global atomic state object
- * @crtc: CRTC to get state object for
- *
- * This function returns the CRTC state for the given CRTC, allocating it if
- * needed. It will also grab the relevant CRTC lock to make sure that the state
- * is consistent.
- *
- * Returns:
- *
- * Either the allocated state or the error code encoded into the pointer. When
- * the error is EDEADLK then the w/w mutex code has detected a deadlock and the
- * entire atomic sequence must be restarted. All other errors are fatal.
- */
-struct drm_crtc_state *
-drm_atomic_get_crtc_state(struct drm_atomic_state *state,
- struct drm_crtc *crtc)
+static struct drm_crtc_state *
+__drm_atomic_get_crtc_state(struct drm_atomic_state *state,
+ struct drm_crtc *crtc, bool take_lock)
{
int ret, index = drm_crtc_index(crtc);
struct drm_crtc_state *crtc_state;
- WARN_ON(!state->acquire_ctx);
-
crtc_state = drm_atomic_get_existing_crtc_state(state, crtc);
if (crtc_state)
return crtc_state;
- ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx);
- if (ret)
- return ERR_PTR(ret);
+ if (take_lock) {
+ WARN_ON(!state->acquire_ctx);
+ ret = drm_modeset_lock(&crtc->mutex, state->acquire_ctx);
+ if (ret)
+ return ERR_PTR(ret);
+ }
crtc_state = crtc->funcs->atomic_duplicate_state(crtc);
if (!crtc_state)
@@ -319,8 +305,37 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state,
return crtc_state;
}
+
+/**
+ * drm_atomic_get_crtc_state - get CRTC state
+ * @state: global atomic state object
+ * @crtc: CRTC to get state object for
+ *
+ * This function returns the CRTC state for the given CRTC, allocating it if
+ * needed. It will also grab the relevant CRTC lock to make sure that the state
+ * is consistent.
+ *
+ * Returns:
+ *
+ * Either the allocated state or the error code encoded into the pointer. When
+ * the error is EDEADLK then the w/w mutex code has detected a deadlock and the
+ * entire atomic sequence must be restarted. All other errors are fatal.
+ */
+struct drm_crtc_state *
+drm_atomic_get_crtc_state(struct drm_atomic_state *state,
+ struct drm_crtc *crtc)
+{
+ return __drm_atomic_get_crtc_state(state, crtc, true);
+}
EXPORT_SYMBOL(drm_atomic_get_crtc_state);
+struct drm_crtc_state *
+drm_atomic_get_crtc_state_nl(struct drm_atomic_state *state,
+ struct drm_crtc *crtc)
+{
+ return __drm_atomic_get_crtc_state(state, crtc, false);
+}
+
static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state,
const struct drm_crtc_state *new_crtc_state)
{
@@ -445,30 +460,13 @@ static int drm_atomic_connector_check(struct drm_connector *connector,
return 0;
}
-/**
- * drm_atomic_get_plane_state - get plane state
- * @state: global atomic state object
- * @plane: plane to get state object for
- *
- * This function returns the plane state for the given plane, allocating it if
- * needed. It will also grab the relevant plane lock to make sure that the state
- * is consistent.
- *
- * Returns:
- *
- * Either the allocated state or the error code encoded into the pointer. When
- * the error is EDEADLK then the w/w mutex code has detected a deadlock and the
- * entire atomic sequence must be restarted. All other errors are fatal.
- */
-struct drm_plane_state *
-drm_atomic_get_plane_state(struct drm_atomic_state *state,
- struct drm_plane *plane)
+static struct drm_plane_state *
+__drm_atomic_get_plane_state(struct drm_atomic_state *state,
+ struct drm_plane *plane, bool take_lock)
{
int ret, index = drm_plane_index(plane);
struct drm_plane_state *plane_state;
- WARN_ON(!state->acquire_ctx);
-
/* the legacy pointers should never be set */
WARN_ON(plane->fb);
WARN_ON(plane->old_fb);
@@ -478,9 +476,12 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,
if (plane_state)
return plane_state;
- ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx);
- if (ret)
- return ERR_PTR(ret);
+ if (take_lock) {
+ WARN_ON(!state->acquire_ctx);
+ ret = drm_modeset_lock(&plane->mutex, state->acquire_ctx);
+ if (ret)
+ return ERR_PTR(ret);
+ }
plane_state = plane->funcs->atomic_duplicate_state(plane);
if (!plane_state)
@@ -506,8 +507,37 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state,
return plane_state;
}
+
+/**
+ * drm_atomic_get_plane_state - get plane state
+ * @state: global atomic state object
+ * @plane: plane to get state object for
+ *
+ * This function returns the plane state for the given plane, allocating it if
+ * needed. It will also grab the relevant plane lock to make sure that the state
+ * is consistent.
+ *
+ * Returns:
+ *
+ * Either the allocated state or the error code encoded into the pointer. When
+ * the error is EDEADLK then the w/w mutex code has detected a deadlock and the
+ * entire atomic sequence must be restarted. All other errors are fatal.
+ */
+struct drm_plane_state *
+drm_atomic_get_plane_state(struct drm_atomic_state *state,
+ struct drm_plane *plane)
+{
+ return __drm_atomic_get_plane_state(state, plane, true);
+}
EXPORT_SYMBOL(drm_atomic_get_plane_state);
+struct drm_plane_state *
+drm_atomic_get_plane_state_nl(struct drm_atomic_state *state,
+ struct drm_plane *plane)
+{
+ return __drm_atomic_get_plane_state(state, plane, false);
+}
+
static bool
plane_switching_crtc(const struct drm_plane_state *old_plane_state,
const struct drm_plane_state *new_plane_state)
@@ -939,19 +969,21 @@ EXPORT_SYMBOL(drm_atomic_get_new_connector_for_encoder);
* the error is EDEADLK then the w/w mutex code has detected a deadlock and the
* entire atomic sequence must be restarted. All other errors are fatal.
*/
-struct drm_connector_state *
-drm_atomic_get_connector_state(struct drm_atomic_state *state,
- struct drm_connector *connector)
+static struct drm_connector_state *
+__drm_atomic_get_connector_state(struct drm_atomic_state *state,
+struct drm_connector *connector, bool take_lock)
{
int ret, index;
struct drm_mode_config *config = &connector->dev->mode_config;
struct drm_connector_state *connector_state;
- WARN_ON(!state->acquire_ctx);
-
- ret = drm_modeset_lock(&config->connection_mutex, state->acquire_ctx);
- if (ret)
- return ERR_PTR(ret);
+ if (take_lock) {
+ WARN_ON(!state->acquire_ctx);
+ ret = drm_modeset_lock(&config->connection_mutex,
+ state->acquire_ctx);
+ if (ret)
+ return ERR_PTR(ret);
+ }
index = drm_connector_index(connector);
@@ -999,8 +1031,22 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state,
return connector_state;
}
+
+struct drm_connector_state *
+drm_atomic_get_connector_state(struct drm_atomic_state *state,
+struct drm_connector *connector)
+{
+ return __drm_atomic_get_connector_state(state, connector, true);
+}
EXPORT_SYMBOL(drm_atomic_get_connector_state);
+struct drm_connector_state *
+drm_atomic_get_connector_state_nl(struct drm_atomic_state *state,
+ struct drm_connector *connector)
+{
+ return __drm_atomic_get_connector_state(state, connector, false);
+}
+
static void drm_atomic_connector_print_state(struct drm_printer *p,
const struct drm_connector_state *state)
{
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ea1926b5bb80..229dc41aedb9 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3140,13 +3140,18 @@ drm_atomic_helper_duplicate_state(struct drm_device *dev,
if (!state)
return ERR_PTR(-ENOMEM);
- state->acquire_ctx = ctx;
+ if (ctx)
+ state->acquire_ctx = ctx;
state->duplicated = true;
drm_for_each_crtc(crtc, dev) {
struct drm_crtc_state *crtc_state;
- crtc_state = drm_atomic_get_crtc_state(state, crtc);
+ if (ctx)
+ crtc_state = drm_atomic_get_crtc_state(state, crtc);
+ else
+ crtc_state = drm_atomic_get_crtc_state_nl(state,
+ crtc);
if (IS_ERR(crtc_state)) {
err = PTR_ERR(crtc_state);
goto free;
@@ -3156,7 +3161,11 @@ drm_atomic_helper_duplicate_state(struct drm_device *dev,
drm_for_each_plane(plane, dev) {
struct drm_plane_state *plane_state;
- plane_state = drm_atomic_get_plane_state(state, plane);
+ if (ctx)
+ plane_state = drm_atomic_get_plane_state(state, plane);
+ else
+ plane_state = drm_atomic_get_plane_state_nl(state,
+ plane);
if (IS_ERR(plane_state)) {
err = PTR_ERR(plane_state);
goto free;
@@ -3167,7 +3176,12 @@ drm_atomic_helper_duplicate_state(struct drm_device *dev,
drm_for_each_connector_iter(conn, &conn_iter) {
struct drm_connector_state *conn_state;
- conn_state = drm_atomic_get_connector_state(state, conn);
+ if (ctx)
+ conn_state = drm_atomic_get_connector_state(state,
+ conn);
+ else
+ conn_state = drm_atomic_get_connector_state_nl(state,
+ conn);
if (IS_ERR(conn_state)) {
err = PTR_ERR(conn_state);
drm_connector_list_iter_end(&conn_iter);
@@ -3189,6 +3203,12 @@ drm_atomic_helper_duplicate_state(struct drm_device *dev,
}
EXPORT_SYMBOL(drm_atomic_helper_duplicate_state);
+struct drm_atomic_state *
+drm_atomic_helper_snapshot_state(struct drm_device *dev)
+{
+ return drm_atomic_helper_duplicate_state(dev, NULL);
+}
+
/**
* drm_atomic_helper_suspend - subsystem-level suspend helper
* @dev: DRM device
diff --git a/include/drm/drm_atomic.h b/include/drm/drm_atomic.h
index 1dc8af7671b7..85e43489e33d 100644
--- a/include/drm/drm_atomic.h
+++ b/include/drm/drm_atomic.h
@@ -452,6 +452,16 @@ struct drm_connector_state * __must_check
drm_atomic_get_connector_state(struct drm_atomic_state *state,
struct drm_connector *connector);
+struct drm_crtc_state *
+drm_atomic_get_crtc_state_nl(struct drm_atomic_state *state,
+ struct drm_crtc *crtc);
+struct drm_plane_state *
+drm_atomic_get_plane_state_nl(struct drm_atomic_state *state,
+ struct drm_plane *plane);
+struct drm_connector_state *
+drm_atomic_get_connector_state_nl(struct drm_atomic_state *state,
+ struct drm_connector *connector);
+
void drm_atomic_private_obj_init(struct drm_device *dev,
struct drm_private_obj *obj,
struct drm_private_state *state,
diff --git a/include/drm/drm_atomic_helper.h b/include/drm/drm_atomic_helper.h
index b268180c97eb..e6be47ba4834 100644
--- a/include/drm/drm_atomic_helper.h
+++ b/include/drm/drm_atomic_helper.h
@@ -126,6 +126,8 @@ void drm_atomic_helper_shutdown(struct drm_device *dev);
struct drm_atomic_state *
drm_atomic_helper_duplicate_state(struct drm_device *dev,
struct drm_modeset_acquire_ctx *ctx);
+struct drm_atomic_state *
+drm_atomic_helper_snapshot_state(struct drm_device *dev);
struct drm_atomic_state *drm_atomic_helper_suspend(struct drm_device *dev);
int drm_atomic_helper_commit_duplicated_state(struct drm_atomic_state *state,
struct drm_modeset_acquire_ctx *ctx);
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project
[View Less]
This is a follow-up of this thread:
https://www.spinics.net/lists/linux-input/msg68446.html
It only touches DRM (dri-devel) in such a way that it changes the help
message of sysrq_drm_fb_helper_restore_op, otherwise it is unrelated to DRM.
Patch 2/2 adds a configurable handler to execute a compound action.
Userland might want to execute e.g. 'w' (show blocked tasks), followed
by 's' (sync), followed by 1000 ms delay and then followed by 'c' (crash)
upon a single magic SysRq. Or one might …
[View More]want to execute the famous "Raising
Elephants Is So Utterly Boring" action. This patch adds a configurable
handler, triggered with 'C', for this exact purpose. The user specifies the
composition of the compound action using syntax similar to getopt, where
each letter corresponds to an individual action and a colon followed by a
number corresponds to a delay of that many milliseconds, e.g.:
ws:1000c
or
r:100eis:1000ub
An example of userspace that wants to perform a compound action is
Chrome OS, where SysRq-X (pressed for the second time within a certain
time period from the first time) causes showing the locked tasks, syncing,
waiting a 1000 ms delay and crashing the system.
Since all the slots in the sysrq_key_table[] are already taken or reserved,
patch 1/2 extends it to cover also capital letter versions.
v2..v3:
- eliminated compile error in !CONFIG_INPUT case (kernel test robot)
v1..v2:
- used toupper() instead of opencoding it (Jiri Slaby)
- updated help message of sysrq_drm_fb_helper_restore_op (Jiri Slaby)
- used unsigned int for specifying delays (Jiri Slaby)
- improved printed messages formatting (Jiri Slaby)
Andrzej Pietrasiewicz (2):
tty/sysrq: Extend the sysrq_key_table to cover capital letters
tty/sysrq: Add configurable handler to execute a compound action
Documentation/admin-guide/sysrq.rst | 11 +++
drivers/gpu/drm/drm_fb_helper.c | 2 +-
drivers/tty/sysrq.c | 129 +++++++++++++++++++++++++++-
include/linux/sysrq.h | 1 +
4 files changed, 140 insertions(+), 3 deletions(-)
base-commit: 9123e3a74ec7b934a4a099e98af6a61c2f80bbf5
--
2.17.1
[View Less]
CMDQ helper provide timer to detect execution timeout, but DRM driver
could have a better way to detect execution timeout by vblank IRQ.
For DRM, CMDQ command should execute in vblank, so if it fail to
execute in next 2 vblank, timeout happen. Even though we could
calculate time between 2 vblank and use timer to delect, this would
make things more complicated.
This introduce a series refinement for CMDQ mailbox controller and CMDQ
helper. Remove timer handler in helper function because …
[View More]different
client have different way to detect timeout. Use standard mailbox
callback instead of proprietary one to get the necessary data
in callback function. Remove struct cmdq_client to access client
instance data by struct mbox_client.
Chun-Kuang Hu (4):
soc / drm: mediatek: cmdq: Remove timeout handler in helper function
mailbox / soc / drm: mediatek: Use mailbox rx_callback instead of
cmdq_task_cb
mailbox / soc / drm: mediatek: Remove struct cmdq_client
drm/mediatek: Detect CMDQ execution timeout
drivers/gpu/drm/mediatek/mtk_drm_crtc.c | 54 ++++++---
drivers/mailbox/mtk-cmdq-mailbox.c | 24 ++--
drivers/soc/mediatek/mtk-cmdq-helper.c | 146 ++---------------------
include/linux/mailbox/mtk-cmdq-mailbox.h | 25 +---
include/linux/soc/mediatek/mtk-cmdq.h | 54 +--------
5 files changed, 66 insertions(+), 237 deletions(-)
--
2.17.1
[View Less]
Hi Dave and Daniel,
Here goes our first next-fixes. Please be aware this includes
both drm-intel-next and drm-intel-gt-next.
Also, most of patches from drm-intel-gt-next were accumulated
for not being part of current drm-intel-fixes flow while we
are defining the new split and flow.
So, there are many important fixes for the next and current release
and also for previous stable branches.
drm-intel-next-fixes-2020-10-02:
Thanks,
Rodrigo.
Propagated from drm-intel-next-queued:
- Fix CRTC …
[View More]state checker (Ville)
Propated from drm-intel-gt-next:
- Avoid implicit vmpa for highmem on 32b (Chris)
- Prevent PAT attriutes for writecombine if CPU doesn't support PAT (Chris)
- Clear the buffer pool age before use. (Chris)
- Fix error code (Dan)
- Break up error capture compression loops (Chris)
- Fix uninitialized variable in context_create_request (Maarten)
- Check for errors on i915_vm_alloc_pt_stash to avoid NULL dereference (Matt)
- Serialize debugfs i915_gem_objects with ctx->mutex (Chris)
- Fix a rebase mistake caused during drm-intel-gt-next creation (Chris)
- Hold request reference for canceling an active context (Chris)
- Heartbeats fixes (Chris)
- Use usigned during batch copies (Chris)
The following changes since commit 32e4d9df60f71d641fbe628a9afbe2f44d7e9a37:
agp: use semicolons rather than commas to separate statements (2020-09-28 06:06:52 +1000)
are available in the Git repository at:
git://anongit.freedesktop.org/drm/drm-intel tags/drm-intel-next-fixes-2020-10-02
for you to fetch changes up to c60b93cd4862d108214a14e655358ea714d7a12a:
drm/i915: Avoid mixing integer types during batch copies (2020-09-30 14:24:54 -0400)
----------------------------------------------------------------
Propagated from drm-intel-next-queued:
- Fix CRTC state checker (Ville)
Propated from drm-intel-gt-next:
- Avoid implicit vmpa for highmem on 32b (Chris)
- Prevent PAT attriutes for writecombine if CPU doesn't support PAT (Chris)
- Clear the buffer pool age before use. (Chris)
- Fix error code (Dan)
- Break up error capture compression loops (Chris)
- Fix uninitialized variable in context_create_request (Maarten)
- Check for errors on i915_vm_alloc_pt_stash to avoid NULL dereference (Matt)
- Serialize debugfs i915_gem_objects with ctx->mutex (Chris)
- Fix a rebase mistake caused during drm-intel-gt-next creation (Chris)
- Hold request reference for canceling an active context (Chris)
- Heartbeats fixes (Chris)
- Use usigned during batch copies (Chris)
----------------------------------------------------------------
Chris Wilson (11):
drm/i915/gem: Avoid implicit vmap for highmem on x86-32
drm/i915/gem: Prevent using pgprot_writecombine() if PAT is not supported
drm/i915/gt: Clear the buffer pool age before use
drm/i915: Break up error capture compression loops with cond_resched()
drm/i915/gem: Serialise debugfs i915_gem_objects with ctx->mutex
drm/i915: Redo "Remove i915_request.lock requirement for execution callbacks"
drm/i915/gem: Hold request reference for canceling an active context
drm/i915: Cancel outstanding work after disabling heartbeats on an engine
drm/i915/gt: Always send a pulse down the engine after disabling heartbeat
drm/i915/gem: Always test execution status on closing the context
drm/i915: Avoid mixing integer types during batch copies
Dan Carpenter (1):
drm/i915: Fix an error code i915_gem_object_copy_blt()
Maarten Lankhorst (1):
drm/i915: Fix uninitialised variable in intel_context_create_request.
Matthew Auld (1):
drm/i915: check i915_vm_alloc_pt_stash for errors
Ville Syrjälä (1):
drm/i915: Fix state checker hw.active/hw.enable readout
drivers/gpu/drm/i915/display/intel_display.c | 15 ++--
drivers/gpu/drm/i915/gem/i915_gem_context.c | 73 +++++++---------
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 7 +-
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c | 2 +-
drivers/gpu/drm/i915/gem/i915_gem_pages.c | 30 ++++++-
drivers/gpu/drm/i915/gt/intel_context.c | 1 +
drivers/gpu/drm/i915/gt/intel_engine.h | 9 ++
drivers/gpu/drm/i915/gt/intel_engine_heartbeat.c | 106 ++++++++++++++---------
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c | 2 +
drivers/gpu/drm/i915/i915_cmd_parser.c | 10 +--
drivers/gpu/drm/i915/i915_debugfs.c | 2 +
drivers/gpu/drm/i915/i915_drv.h | 4 +-
drivers/gpu/drm/i915/i915_gpu_error.c | 3 +
drivers/gpu/drm/i915/i915_request.c | 17 ++--
drivers/gpu/drm/i915/i915_vma.c | 8 +-
15 files changed, 175 insertions(+), 114 deletions(-)
[View Less]
From: Colin Ian King <colin.king(a)canonical.com>
Currently the check that the unsigned size_t variable i is >= 0
is always true because the unsigned variable will never be negative,
causing the loop to run forever. Fix this by changing the
pre-decrement check to a zero check on i followed by a decrement of i.
Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 400b65cb5acb ("drm/i915: use vmap in shmem_pin_map")
Signed-off-by: Colin Ian King <colin.king(a)canonical.com…
[View More]>
---
drivers/gpu/drm/i915/gt/shmem_utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/gt/shmem_utils.c b/drivers/gpu/drm/i915/gt/shmem_utils.c
index f011ea42487e..30cc56fa191f 100644
--- a/drivers/gpu/drm/i915/gt/shmem_utils.c
+++ b/drivers/gpu/drm/i915/gt/shmem_utils.c
@@ -73,7 +73,7 @@ void *shmem_pin_map(struct file *file)
mapping_set_unevictable(file->f_mapping);
return vaddr;
err_page:
- while (--i >= 0)
+ while (i--)
put_page(pages[i]);
kvfree(pages);
return NULL;
--
2.27.0
[View Less]
From: Leon Romanovsky <leonro(a)nvidia.com>
Changelog:
v4:
* Fixed formatting in first patch.
* Added fix (clear tmp_netnts) in first patch to fix i915 failure.
* Added test patches
v3: https://lore.kernel.org/linux-rdma/20200922083958.2150803-1-leon@kernel.org/
* Squashed Christopher's suggestion to avoid introduced new API, but extend existing one.
v2: https://lore.kernel.org/linux-rdma/20200916140726.839377-1-leon@kernel.org
* Fixed indentations and comments
* Deleted …
[View More]sg_alloc_next()
* Squashed lib/scatterlist patches into one
v1: https://lore.kernel.org/lkml/20200910134259.1304543-1-leon@kernel.org
* Changed _sg_chain to be __sg_chain
* Added dependency on ARCH_NO_SG_CHAIN
* Removed struct sg_append
v0:
* https://lore.kernel.org/lkml/20200903121853.1145976-1-leon@kernel.org
--------------------------------------------------------------------------
>From Maor:
This series extends __sg_alloc_table_from_pages to allow chaining of
new pages to already initialized SG table.
This allows drivers to utilize the optimization of merging contiguous
pages without a need to pre allocate all the pages and hold them in
a very large temporary buffer prior to the call to SG table initialization.
The second patch changes the Infiniband driver to use the new API. It
removes duplicate functionality from the code and benefits the
optimization of allocating dynamic SG table from pages.
In huge pages system of 2MB page size, without this change, the SG table
would contain x512 SG entries.
E.g. for 100GB memory registration:
Number of entries Size
Before 26214400 600.0MB
After 51200 1.2MB
Thanks
Maor Gottlieb (2):
lib/scatterlist: Add support in dynamic allocation of SG table from
pages
RDMA/umem: Move to allocate SG table from pages
Tvrtko Ursulin (2):
tools/testing/scatterlist: Rejuvenate bit-rotten test
tools/testing/scatterlist: Show errors in human readable form
drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 12 +-
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c | 15 +-
drivers/infiniband/core/umem.c | 92 ++---------
include/linux/scatterlist.h | 43 +++---
lib/scatterlist.c | 160 +++++++++++++++-----
lib/sg_pool.c | 3 +-
tools/testing/scatterlist/Makefile | 3 +-
tools/testing/scatterlist/linux/mm.h | 35 +++++
tools/testing/scatterlist/main.c | 53 +++++--
9 files changed, 248 insertions(+), 168 deletions(-)
--
2.26.2
[View Less]