gpu_nomali.cc (11349:9e46b77e5e56) gpu_nomali.cc (11350:ef6e57ac0d70)
1/*
2 * Copyright (c) 2014-2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 78 unchanged lines hidden (view full) ---

87
88 /* Setup an interrupt callback */
89 nomali_callback_t cbk_int;
90 cbk_int.type = NOMALI_CALLBACK_INT;
91 cbk_int.usr = (void *)this;
92 cbk_int.func.interrupt = NoMaliGpu::_interrupt;
93 setCallback(cbk_int);
94
1/*
2 * Copyright (c) 2014-2016 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 78 unchanged lines hidden (view full) ---

87
88 /* Setup an interrupt callback */
89 nomali_callback_t cbk_int;
90 cbk_int.type = NOMALI_CALLBACK_INT;
91 cbk_int.usr = (void *)this;
92 cbk_int.func.interrupt = NoMaliGpu::_interrupt;
93 setCallback(cbk_int);
94
95 /* Setup a reset callback */
96 nomali_callback_t cbk_rst;
97 cbk_rst.type = NOMALI_CALLBACK_RESET;
98 cbk_rst.usr = (void *)this;
99 cbk_rst.func.reset = NoMaliGpu::_reset;
100 setCallback(cbk_rst);
101
95 panicOnErr(
96 nomali_get_info(nomali, &nomaliInfo),
97 "Failed to get NoMali information struct");
98}
99
100NoMaliGpu::~NoMaliGpu()
101{
102 nomali_destroy(nomali);
103}
104
102 panicOnErr(
103 nomali_get_info(nomali, &nomaliInfo),
104 "Failed to get NoMali information struct");
105}
106
107NoMaliGpu::~NoMaliGpu()
108{
109 nomali_destroy(nomali);
110}
111
112
105void
113void
114NoMaliGpu::init()
115{
116 PioDevice::init();
117
118 /* Reset the GPU here since the reset callback won't have been
119 * installed when the GPU was reset at instantiation time.
120 */
121 reset();
122}
123
124void
106NoMaliGpu::serialize(CheckpointOut &cp) const
107{
108 std::vector<uint32_t> regs(nomaliInfo.reg_size >> 2);
109
110 for (int i = 0; i < nomaliInfo.reg_size; i += 4)
111 regs[i >> 2] = readRegRaw(i);
112
113 SERIALIZE_CONTAINER(regs);

--- 149 unchanged lines hidden (view full) ---

263
264 if (set)
265 platform->gic->sendInt(it_int->second);
266 else
267 platform->gic->clearInt(it_int->second);
268}
269
270void
125NoMaliGpu::serialize(CheckpointOut &cp) const
126{
127 std::vector<uint32_t> regs(nomaliInfo.reg_size >> 2);
128
129 for (int i = 0; i < nomaliInfo.reg_size; i += 4)
130 regs[i >> 2] = readRegRaw(i);
131
132 SERIALIZE_CONTAINER(regs);

--- 149 unchanged lines hidden (view full) ---

282
283 if (set)
284 platform->gic->sendInt(it_int->second);
285 else
286 platform->gic->clearInt(it_int->second);
287}
288
289void
290NoMaliGpu::onReset()
291{
292 DPRINTF(NoMali, "Reset\n");
293}
294
295void
271NoMaliGpu::setCallback(const nomali_callback_t &callback)
272{
273 DPRINTF(NoMali, "Registering callback %i\n",
274 callback.type);
275
276 panicOnErr(
277 nomali_set_callback(nomali, &callback),
278 "Failed to register callback");
279}
280
281void
282NoMaliGpu::_interrupt(nomali_handle_t h, void *usr,
283 nomali_int_t intno, int set)
284{
285 NoMaliGpu *_this(static_cast<NoMaliGpu *>(usr));
286
287 _this->onInterrupt(intno, !!set);
288}
289
296NoMaliGpu::setCallback(const nomali_callback_t &callback)
297{
298 DPRINTF(NoMali, "Registering callback %i\n",
299 callback.type);
300
301 panicOnErr(
302 nomali_set_callback(nomali, &callback),
303 "Failed to register callback");
304}
305
306void
307NoMaliGpu::_interrupt(nomali_handle_t h, void *usr,
308 nomali_int_t intno, int set)
309{
310 NoMaliGpu *_this(static_cast<NoMaliGpu *>(usr));
311
312 _this->onInterrupt(intno, !!set);
313}
314
315void
316NoMaliGpu::_reset(nomali_handle_t h, void *usr)
317{
318 NoMaliGpu *_this(static_cast<NoMaliGpu *>(usr));
319
320 _this->onReset();
321}
322
290NoMaliGpu *
291NoMaliGpuParams::create()
292{
293 return new NoMaliGpu(this);
294}
323NoMaliGpu *
324NoMaliGpuParams::create()
325{
326 return new NoMaliGpu(this);
327}