summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
diff options
context:
space:
mode:
authorDrew Davenport <ddavenport@chromium.org>2020-02-19 10:42:26 -0700
committerRob Clark <robdclark@chromium.org>2020-03-19 11:35:37 -0700
commitbb00a452d6f77391441ef7df48f7115dd459cd2f (patch)
tree59a1c52320a255b91de74807ab9810b3389e5fde /drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
parentb954fa6baaca7ac171224ae4bcbd7c0e54016cd5 (diff)
downloadlinux-stable-bb00a452d6f77391441ef7df48f7115dd459cd2f.tar.gz
linux-stable-bb00a452d6f77391441ef7df48f7115dd459cd2f.tar.bz2
linux-stable-bb00a452d6f77391441ef7df48f7115dd459cd2f.zip
drm/msm/dpu: Refactor resource manager
Track hardware resource objects in arrays rather than a list and remove the resource manager's iterator idiom. Separate the mapping of hardware resources to an encoder ID into a different array. Use an implicit mapping between the hardware blocks' ids, which are 1-based, and array indices in these arrays to replace iteration with index lookups in several places. Signed-off-by: Drew Davenport <ddavenport@chromium.org> [squash in minor compiler warning fixes] Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h')
-rw-r--r--drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
index 982b91e27227..9c8a436ba6cc 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
@@ -11,15 +11,31 @@
#include "msm_kms.h"
#include "dpu_hw_top.h"
+
/**
* struct dpu_rm - DPU dynamic hardware resource manager
- * @hw_blks: array of lists of hardware resources present in the system, one
- * list per type of hardware block
+ * @pingpong_blks: array of pingpong hardware resources
+ * @mixer_blks: array of layer mixer hardware resources
+ * @ctl_blks: array of ctl hardware resources
+ * @intf_blks: array of intf hardware resources
+ * @pingpong_to_enc_id: mapping of pingpong hardware resources to an encoder ID
+ * @mixer_to_enc_id: mapping of mixer hardware resources to an encoder ID
+ * @ctl_to_enc_id: mapping of ctl hardware resources to an encoder ID
+ * @intf_to_enc_id: mapping of intf hardware resources to an encoder ID
* @lm_max_width: cached layer mixer maximum width
* @rm_lock: resource manager mutex
*/
struct dpu_rm {
- struct list_head hw_blks[DPU_HW_BLK_MAX];
+ struct dpu_hw_blk *pingpong_blks[PINGPONG_MAX - PINGPONG_0];
+ struct dpu_hw_blk *mixer_blks[LM_MAX - LM_0];
+ struct dpu_hw_blk *ctl_blks[CTL_MAX - CTL_0];
+ struct dpu_hw_blk *intf_blks[INTF_MAX - INTF_0];
+
+ uint32_t pingpong_to_enc_id[PINGPONG_MAX - PINGPONG_0];
+ uint32_t mixer_to_enc_id[LM_MAX - LM_0];
+ uint32_t ctl_to_enc_id[CTL_MAX - CTL_0];
+ uint32_t intf_to_enc_id[INTF_MAX - INTF_0];
+
uint32_t lm_max_width;
struct mutex rm_lock;
};