diff options
author | Christian Gmeiner | 2017-03-26 08:57:28 -0500 |
---|---|---|
committer | Christian Gmeiner | 2017-04-01 10:12:02 -0500 |
commit | 18fbd7f0899d4e67a6902813a46be2983986c21c (patch) | |
tree | bbb935e001e07b629cb897208cba8d0feb7df0e9 /etnaviv/etnaviv_gpu.c | |
parent | 8d61a9a923c1ced974180609611ef615034fd484 (diff) | |
download | external-libgbm-18fbd7f0899d4e67a6902813a46be2983986c21c.tar.gz external-libgbm-18fbd7f0899d4e67a6902813a46be2983986c21c.tar.xz external-libgbm-18fbd7f0899d4e67a6902813a46be2983986c21c.zip |
etnaviv: remove struct etna_specs
There is no need to cache spec values directly as library
users will cache them anyway.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Diffstat (limited to 'etnaviv/etnaviv_gpu.c')
-rw-r--r-- | etnaviv/etnaviv_gpu.c | 72 |
1 files changed, 28 insertions, 44 deletions
diff --git a/etnaviv/etnaviv_gpu.c b/etnaviv/etnaviv_gpu.c index 35dec6cd..bc355e8f 100644 --- a/etnaviv/etnaviv_gpu.c +++ b/etnaviv/etnaviv_gpu.c | |||
@@ -61,32 +61,13 @@ struct etna_gpu *etna_gpu_new(struct etna_device *dev, unsigned int core) | |||
61 | gpu->dev = dev; | 61 | gpu->dev = dev; |
62 | gpu->core = core; | 62 | gpu->core = core; |
63 | 63 | ||
64 | /* get specs from kernel space */ | 64 | gpu->model = get_param(dev, core, ETNAVIV_PARAM_GPU_MODEL); |
65 | gpu->specs.model = get_param(dev, core, ETNAVIV_PARAM_GPU_MODEL); | 65 | gpu->revision = get_param(dev, core, ETNAVIV_PARAM_GPU_REVISION); |
66 | gpu->specs.revision = get_param(dev, core, ETNAVIV_PARAM_GPU_REVISION); | 66 | |
67 | gpu->specs.features[0] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_0); | 67 | if (!gpu->model) |
68 | gpu->specs.features[1] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_1); | ||
69 | gpu->specs.features[2] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_2); | ||
70 | gpu->specs.features[3] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_3); | ||
71 | gpu->specs.features[4] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_4); | ||
72 | gpu->specs.features[5] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_5); | ||
73 | gpu->specs.features[6] = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_6); | ||
74 | gpu->specs.stream_count = get_param(dev, core, ETNA_GPU_STREAM_COUNT); | ||
75 | gpu->specs.register_max = get_param(dev, core, ETNA_GPU_REGISTER_MAX); | ||
76 | gpu->specs.thread_count = get_param(dev, core, ETNA_GPU_THREAD_COUNT); | ||
77 | gpu->specs.vertex_cache_size = get_param(dev, core, ETNA_GPU_VERTEX_CACHE_SIZE); | ||
78 | gpu->specs.shader_core_count = get_param(dev, core, ETNA_GPU_SHADER_CORE_COUNT); | ||
79 | gpu->specs.pixel_pipes = get_param(dev, core, ETNA_GPU_PIXEL_PIPES); | ||
80 | gpu->specs.vertex_output_buffer_size = get_param(dev, core, ETNA_GPU_VERTEX_OUTPUT_BUFFER_SIZE); | ||
81 | gpu->specs.buffer_size = get_param(dev, core, ETNA_GPU_BUFFER_SIZE); | ||
82 | gpu->specs.instruction_count = get_param(dev, core, ETNA_GPU_INSTRUCTION_COUNT); | ||
83 | gpu->specs.num_constants = get_param(dev, core, ETNA_GPU_NUM_CONSTANTS); | ||
84 | gpu->specs.num_varyings = get_param(dev, core, ETNA_GPU_NUM_VARYINGS); | ||
85 | |||
86 | if (!gpu->specs.model) | ||
87 | goto fail; | 68 | goto fail; |
88 | 69 | ||
89 | INFO_MSG(" GPU model: 0x%x (rev %x)", gpu->specs.model, gpu->specs.revision); | 70 | INFO_MSG(" GPU model: 0x%x (rev %x)", gpu->model, gpu->revision); |
90 | 71 | ||
91 | return gpu; | 72 | return gpu; |
92 | fail: | 73 | fail: |
@@ -104,66 +85,69 @@ void etna_gpu_del(struct etna_gpu *gpu) | |||
104 | int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param, | 85 | int etna_gpu_get_param(struct etna_gpu *gpu, enum etna_param_id param, |
105 | uint64_t *value) | 86 | uint64_t *value) |
106 | { | 87 | { |
88 | struct etna_device *dev = gpu->dev; | ||
89 | unsigned int core = gpu->core; | ||
90 | |||
107 | switch(param) { | 91 | switch(param) { |
108 | case ETNA_GPU_MODEL: | 92 | case ETNA_GPU_MODEL: |
109 | *value = gpu->specs.model; | 93 | *value = gpu->model; |
110 | return 0; | 94 | return 0; |
111 | case ETNA_GPU_REVISION: | 95 | case ETNA_GPU_REVISION: |
112 | *value = gpu->specs.revision; | 96 | *value = gpu->revision; |
113 | return 0; | 97 | return 0; |
114 | case ETNA_GPU_FEATURES_0: | 98 | case ETNA_GPU_FEATURES_0: |
115 | *value = gpu->specs.features[0]; | 99 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_0); |
116 | return 0; | 100 | return 0; |
117 | case ETNA_GPU_FEATURES_1: | 101 | case ETNA_GPU_FEATURES_1: |
118 | *value = gpu->specs.features[1]; | 102 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_1); |
119 | return 0; | 103 | return 0; |
120 | case ETNA_GPU_FEATURES_2: | 104 | case ETNA_GPU_FEATURES_2: |
121 | *value = gpu->specs.features[2]; | 105 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_2); |
122 | return 0; | 106 | return 0; |
123 | case ETNA_GPU_FEATURES_3: | 107 | case ETNA_GPU_FEATURES_3: |
124 | *value = gpu->specs.features[3]; | 108 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_3); |
125 | return 0; | 109 | return 0; |
126 | case ETNA_GPU_FEATURES_4: | 110 | case ETNA_GPU_FEATURES_4: |
127 | *value = gpu->specs.features[4]; | 111 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_4); |
128 | return 0; | 112 | return 0; |
129 | case ETNA_GPU_FEATURES_5: | 113 | case ETNA_GPU_FEATURES_5: |
130 | *value = gpu->specs.features[5]; | 114 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_5); |
131 | return 0; | 115 | return 0; |
132 | case ETNA_GPU_FEATURES_6: | 116 | case ETNA_GPU_FEATURES_6: |
133 | *value = gpu->specs.features[6]; | 117 | *value = get_param(dev, core, ETNAVIV_PARAM_GPU_FEATURES_6); |
134 | return 0; | 118 | return 0; |
135 | case ETNA_GPU_STREAM_COUNT: | 119 | case ETNA_GPU_STREAM_COUNT: |
136 | *value = gpu->specs.stream_count; | 120 | *value = get_param(dev, core, ETNA_GPU_STREAM_COUNT); |
137 | return 0; | 121 | return 0; |
138 | case ETNA_GPU_REGISTER_MAX: | 122 | case ETNA_GPU_REGISTER_MAX: |
139 | *value = gpu->specs.register_max; | 123 | *value = get_param(dev, core, ETNA_GPU_REGISTER_MAX); |
140 | return 0; | 124 | return 0; |
141 | case ETNA_GPU_THREAD_COUNT: | 125 | case ETNA_GPU_THREAD_COUNT: |
142 | *value = gpu->specs.thread_count; | 126 | *value = get_param(dev, core, ETNA_GPU_THREAD_COUNT); |
143 | return 0; | 127 | return 0; |
144 | case ETNA_GPU_VERTEX_CACHE_SIZE: | 128 | case ETNA_GPU_VERTEX_CACHE_SIZE: |
145 | *value = gpu->specs.vertex_cache_size; | 129 | *value = get_param(dev, core, ETNA_GPU_VERTEX_CACHE_SIZE); |
146 | return 0; | 130 | return 0; |
147 | case ETNA_GPU_SHADER_CORE_COUNT: | 131 | case ETNA_GPU_SHADER_CORE_COUNT: |
148 | *value = gpu->specs.shader_core_count; | 132 | *value = get_param(dev, core, ETNA_GPU_SHADER_CORE_COUNT); |
149 | return 0; | 133 | return 0; |
150 | case ETNA_GPU_PIXEL_PIPES: | 134 | case ETNA_GPU_PIXEL_PIPES: |
151 | *value = gpu->specs.pixel_pipes; | 135 | *value = get_param(dev, core, ETNA_GPU_PIXEL_PIPES); |
152 | return 0; | 136 | return 0; |
153 | case ETNA_GPU_VERTEX_OUTPUT_BUFFER_SIZE: | 137 | case ETNA_GPU_VERTEX_OUTPUT_BUFFER_SIZE: |
154 | *value = gpu->specs.vertex_output_buffer_size; | 138 | *value = get_param(dev, core, ETNA_GPU_VERTEX_OUTPUT_BUFFER_SIZE); |
155 | return 0; | 139 | return 0; |
156 | case ETNA_GPU_BUFFER_SIZE: | 140 | case ETNA_GPU_BUFFER_SIZE: |
157 | *value = gpu->specs.buffer_size; | 141 | *value = get_param(dev, core, ETNA_GPU_BUFFER_SIZE); |
158 | return 0; | 142 | return 0; |
159 | case ETNA_GPU_INSTRUCTION_COUNT: | 143 | case ETNA_GPU_INSTRUCTION_COUNT: |
160 | *value = gpu->specs.instruction_count; | 144 | *value = get_param(dev, core, ETNA_GPU_INSTRUCTION_COUNT); |
161 | return 0; | 145 | return 0; |
162 | case ETNA_GPU_NUM_CONSTANTS: | 146 | case ETNA_GPU_NUM_CONSTANTS: |
163 | *value = gpu->specs.num_constants; | 147 | *value = get_param(dev, core, ETNA_GPU_NUM_CONSTANTS); |
164 | return 0; | 148 | return 0; |
165 | case ETNA_GPU_NUM_VARYINGS: | 149 | case ETNA_GPU_NUM_VARYINGS: |
166 | *value = gpu->specs.num_varyings; | 150 | *value = get_param(dev, core, ETNA_GPU_NUM_VARYINGS); |
167 | return 0; | 151 | return 0; |
168 | 152 | ||
169 | default: | 153 | default: |