gpu_nomali.cc (11350:ef6e57ac0d70) gpu_nomali.cc (11619:8bc53d5565ba)
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

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

39
40#include "dev/arm/gpu_nomali.hh"
41
42#include "debug/NoMali.hh"
43#include "dev/arm/base_gic.hh"
44#include "dev/arm/realview.hh"
45#include "enums/MemoryMode.hh"
46#include "mem/packet_access.hh"
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

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

39
40#include "dev/arm/gpu_nomali.hh"
41
42#include "debug/NoMali.hh"
43#include "dev/arm/base_gic.hh"
44#include "dev/arm/realview.hh"
45#include "enums/MemoryMode.hh"
46#include "mem/packet_access.hh"
47#include "nomali/lib/mali_midg_regmap.h"
48#include "params/CustomNoMaliGpu.hh"
47#include "params/NoMaliGpu.hh"
48
49static const std::map<Enums::NoMaliGpuType, nomali_gpu_type_t> gpuTypeMap{
50 { Enums::T60x, NOMALI_GPU_T60X },
51 { Enums::T62x, NOMALI_GPU_T62X },
52 { Enums::T760, NOMALI_GPU_T760 },
53};
54

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

315void
316NoMaliGpu::_reset(nomali_handle_t h, void *usr)
317{
318 NoMaliGpu *_this(static_cast<NoMaliGpu *>(usr));
319
320 _this->onReset();
321}
322
49#include "params/NoMaliGpu.hh"
50
51static const std::map<Enums::NoMaliGpuType, nomali_gpu_type_t> gpuTypeMap{
52 { Enums::T60x, NOMALI_GPU_T60X },
53 { Enums::T62x, NOMALI_GPU_T62X },
54 { Enums::T760, NOMALI_GPU_T760 },
55};
56

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

317void
318NoMaliGpu::_reset(nomali_handle_t h, void *usr)
319{
320 NoMaliGpu *_this(static_cast<NoMaliGpu *>(usr));
321
322 _this->onReset();
323}
324
325
326CustomNoMaliGpu::CustomNoMaliGpu(const CustomNoMaliGpuParams *p)
327 : NoMaliGpu(p),
328 idRegs{
329 { GPU_CONTROL_REG(GPU_ID), p->gpu_id },
330 { GPU_CONTROL_REG(L2_FEATURES), p->l2_features },
331 { GPU_CONTROL_REG(TILER_FEATURES), p->tiler_features },
332 { GPU_CONTROL_REG(MEM_FEATURES), p->mem_features },
333 { GPU_CONTROL_REG(MMU_FEATURES), p->mmu_features },
334 { GPU_CONTROL_REG(AS_PRESENT), p->as_present },
335 { GPU_CONTROL_REG(JS_PRESENT), p->js_present },
336
337 { GPU_CONTROL_REG(THREAD_MAX_THREADS), p->thread_max_threads },
338 { GPU_CONTROL_REG(THREAD_MAX_WORKGROUP_SIZE),
339 p->thread_max_workgroup_size },
340 { GPU_CONTROL_REG(THREAD_MAX_BARRIER_SIZE),
341 p->thread_max_barrier_size },
342 { GPU_CONTROL_REG(THREAD_FEATURES), p->thread_features },
343
344 { GPU_CONTROL_REG(SHADER_PRESENT_LO), bits(p->shader_present, 31, 0) },
345 { GPU_CONTROL_REG(SHADER_PRESENT_HI), bits(p->shader_present, 63, 32) },
346 { GPU_CONTROL_REG(TILER_PRESENT_LO), bits(p->tiler_present, 31, 0) },
347 { GPU_CONTROL_REG(TILER_PRESENT_HI), bits(p->tiler_present, 63, 32) },
348 { GPU_CONTROL_REG(L2_PRESENT_LO), bits(p->l2_present, 31, 0) },
349 { GPU_CONTROL_REG(L2_PRESENT_HI), bits(p->l2_present, 63, 32) },
350 }
351{
352 fatal_if(p->texture_features.size() > 3,
353 "Too many texture feature registers specified (%i)\n",
354 p->texture_features.size());
355
356 fatal_if(p->js_features.size() > 16,
357 "Too many job slot feature registers specified (%i)\n",
358 p->js_features.size());
359
360 for (int i = 0; i < p->texture_features.size(); i++)
361 idRegs[TEXTURE_FEATURES_REG(i)] = p->texture_features[i];
362
363 for (int i = 0; i < p->js_features.size(); i++)
364 idRegs[JS_FEATURES_REG(i)] = p->js_features[i];
365}
366
367CustomNoMaliGpu::~CustomNoMaliGpu()
368{
369}
370
371void
372CustomNoMaliGpu::onReset()
373{
374 NoMaliGpu::onReset();
375
376 for (const auto &reg : idRegs)
377 writeRegRaw(reg.first, reg.second);
378}
379
380
381
323NoMaliGpu *
324NoMaliGpuParams::create()
325{
326 return new NoMaliGpu(this);
327}
382NoMaliGpu *
383NoMaliGpuParams::create()
384{
385 return new NoMaliGpu(this);
386}
387
388CustomNoMaliGpu *
389CustomNoMaliGpuParams::create()
390{
391 return new CustomNoMaliGpu(this);
392}