drm/amdkfd: Use new struct for asic specific ops
authorOded Gabbay <oded.gabbay@gmail.com>
Tue, 5 May 2015 08:51:31 +0000 (11:51 +0300)
committerOded Gabbay <oded.gabbay@gmail.com>
Tue, 19 May 2015 09:13:38 +0000 (12:13 +0300)
This patch creates a new structure for asic specific operations, instead
of using the existing structure of operations.

This is done to make the code flow more logic, readable and maintainable.

The change is done only to the device queue manager module at this point.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.h
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_cik.c
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager_vi.c

index 488f51d19427a8273b672df18962a4dafe9feaf5..650ae1c9ceca33546e6779c52063c1f955ee9ace 100644 (file)
@@ -120,6 +120,18 @@ struct device_queue_manager_ops {
                                           uint64_t alternate_aperture_size);
 };
 
+struct device_queue_manager_asic_ops {
+       int     (*register_process)(struct device_queue_manager *dqm,
+                                       struct qcm_process_device *qpd);
+       int     (*initialize)(struct device_queue_manager *dqm);
+       bool    (*set_cache_memory_policy)(struct device_queue_manager *dqm,
+                                          struct qcm_process_device *qpd,
+                                          enum cache_policy default_policy,
+                                          enum cache_policy alternate_policy,
+                                          void __user *alternate_aperture_base,
+                                          uint64_t alternate_aperture_size);
+};
+
 /**
  * struct device_queue_manager
  *
@@ -134,7 +146,7 @@ struct device_queue_manager_ops {
 
 struct device_queue_manager {
        struct device_queue_manager_ops ops;
-       struct device_queue_manager_ops ops_asic_specific;
+       struct device_queue_manager_asic_ops ops_asic_specific;
 
        struct mqd_manager      *mqds[KFD_MQD_TYPE_MAX];
        struct packet_manager   packets;
@@ -157,8 +169,8 @@ struct device_queue_manager {
        bool                    active_runlist;
 };
 
-void device_queue_manager_init_cik(struct device_queue_manager_ops *ops);
-void device_queue_manager_init_vi(struct device_queue_manager_ops *ops);
+void device_queue_manager_init_cik(struct device_queue_manager_asic_ops *ops);
+void device_queue_manager_init_vi(struct device_queue_manager_asic_ops *ops);
 void program_sh_mem_settings(struct device_queue_manager *dqm,
                                        struct qcm_process_device *qpd);
 int init_pipelines(struct device_queue_manager *dqm,
index 5469efe0523e8d85b11ad33729bfed9036051dfa..292d13ff3ef584e9f411c2af2cbb2bdb430b22f3 100644 (file)
@@ -34,7 +34,7 @@ static int register_process_cik(struct device_queue_manager *dqm,
                                        struct qcm_process_device *qpd);
 static int initialize_cpsch_cik(struct device_queue_manager *dqm);
 
-void device_queue_manager_init_cik(struct device_queue_manager_ops *ops)
+void device_queue_manager_init_cik(struct device_queue_manager_asic_ops *ops)
 {
        ops->set_cache_memory_policy = set_cache_memory_policy_cik;
        ops->register_process = register_process_cik;
index 20553dcd257d86f0cc228c2bfa5f2e67488bacf9..8b00ccf1f7955f51b7146e94c9326b115b5a7693 100644 (file)
@@ -33,7 +33,7 @@ static int register_process_vi(struct device_queue_manager *dqm,
                                        struct qcm_process_device *qpd);
 static int initialize_cpsch_vi(struct device_queue_manager *dqm);
 
-void device_queue_manager_init_vi(struct device_queue_manager_ops *ops)
+void device_queue_manager_init_vi(struct device_queue_manager_asic_ops *ops)
 {
        pr_warn("amdkfd: VI DQM is not currently supported\n");