-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathadreno.h
More file actions
2380 lines (2144 loc) · 78.4 KB
/
Copy pathadreno.h
File metadata and controls
2380 lines (2144 loc) · 78.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2008-2021, The Linux Foundation. All rights reserved.
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#ifndef __ADRENO_H
#define __ADRENO_H
#include <linux/firmware.h>
#include <linux/iopoll.h>
#include <linux/of.h>
#include <linux/soc/qcom/llcc-qcom.h>
#include "adreno_coresight.h"
#include "adreno_dispatch.h"
#include "adreno_drawctxt.h"
#include "adreno_hwsched.h"
#include "adreno_perfcounter.h"
#include "adreno_profile.h"
#include "adreno_ringbuffer.h"
#include "kgsl_sharedmem.h"
/* Used to point CP to the SMMU record during preemption */
#define SET_PSEUDO_SMMU_INFO 0
/* Used to inform CP where to save preemption data at the time of switch out */
#define SET_PSEUDO_PRIV_NON_SECURE_SAVE_ADDR 1
/* Used to inform CP where to save secure preemption data at the time of switch out */
#define SET_PSEUDO_PRIV_SECURE_SAVE_ADDR 2
/* Used to inform CP where to save per context non-secure data at the time of switch out */
#define SET_PSEUDO_NON_PRIV_SAVE_ADDR 3
/* Used to inform CP where to save preemption counter data at the time of switch out */
#define SET_PSEUDO_COUNTER 4
/* Index to preemption scratch buffer to store current QOS value */
#define QOS_VALUE_IDX KGSL_PRIORITY_MAX_RB_LEVELS
/* Size of the user context record block (in bytes) */
#define ADRENO_CP_CTXRECORD_USER_RESTORE_SIZE (192 * SZ_1K)
/* ADRENO_DEVICE - Given a kgsl_device return the adreno device struct */
#define ADRENO_DEVICE(device) \
container_of(device, struct adreno_device, dev)
/* KGSL_DEVICE - given an adreno_device, return the KGSL device struct */
#define KGSL_DEVICE(_dev) (&((_dev)->dev))
/* ADRENO_CONTEXT - Given a context return the adreno context struct */
#define ADRENO_CONTEXT(context) \
container_of(context, struct adreno_context, base)
/* ADRENO_GPU_DEVICE - Given an adreno device return the GPU specific struct */
#define ADRENO_GPU_DEVICE(_a) ((_a)->gpucore->gpudev)
/*
* ADRENO_POWER_OPS - Given an adreno device return the GPU specific power
* ops
*/
#define ADRENO_POWER_OPS(_a) ((_a)->gpucore->gpudev->power_ops)
#define ADRENO_CHIPID_CORE(_id) FIELD_GET(GENMASK(31, 24), _id)
#define ADRENO_CHIPID_MAJOR(_id) FIELD_GET(GENMASK(23, 16), _id)
#define ADRENO_CHIPID_MINOR(_id) FIELD_GET(GENMASK(15, 8), _id)
#define ADRENO_CHIPID_PATCH(_id) FIELD_GET(GENMASK(7, 0), _id)
#define ADRENO_GMU_CHIPID(_id) \
(FIELD_PREP(GENMASK(31, 24), ADRENO_CHIPID_CORE(_id)) | \
FIELD_PREP(GENMASK(23, 16), ADRENO_CHIPID_MAJOR(_id)) | \
FIELD_PREP(GENMASK(15, 12), ADRENO_CHIPID_MINOR(_id)) | \
FIELD_PREP(GENMASK(11, 8), ADRENO_CHIPID_PATCH(_id)))
#define ADRENO_REV_MAJOR(_rev) FIELD_GET(GENMASK(23, 16), _rev)
#define ADRENO_REV_MINOR(_rev) FIELD_GET(GENMASK(15, 8), _rev)
#define ADRENO_REV_PATCH(_rev) FIELD_GET(GENMASK(7, 0), _rev)
#define ADRENO_GMU_REV(_rev) \
(FIELD_PREP(GENMASK(31, 24), ADRENO_REV_MAJOR(_rev)) | \
FIELD_PREP(GENMASK(23, 16), ADRENO_REV_MINOR(_rev)) | \
FIELD_PREP(GENMASK(15, 8), ADRENO_REV_PATCH(_rev)))
/* ADRENO_GPUREV - Return the GPU ID for the given adreno_device */
#define ADRENO_GPUREV(_a) ((_a)->gpucore->gpurev)
/*
* Disable local interrupts and CPU preemption to avoid interruptions
* while holding the CP semaphore; otherwise, it could stall the CP.
* Make sure to call ADRENO_RELEASE_CP_SEMAPHORE after calling the
* below macro to reenable CPU interrupts.
*/
#define ADRENO_ACQUIRE_CP_SEMAPHORE(_adreno_dev, _flags) \
({ \
bool ret = true; \
if ((_adreno_dev)->gpucore->gpudev->acquire_cp_semaphore) { \
local_irq_save(_flags); \
preempt_disable(); \
ret = (_adreno_dev)->gpucore->gpudev->acquire_cp_semaphore(_adreno_dev); \
if (!ret) { \
preempt_enable(); \
local_irq_restore(_flags); \
dev_err_ratelimited(KGSL_DEVICE(_adreno_dev)->dev, \
"Timed out waiting to acquire CP semaphore: status=0x%08x\n", \
ret); \
} \
} \
ret; \
})
#define ADRENO_RELEASE_CP_SEMAPHORE(_adreno_dev, _flags) \
({ \
do { \
if ((_adreno_dev)->gpucore->gpudev->release_cp_semaphore) { \
(_adreno_dev)->gpucore->gpudev->release_cp_semaphore(_adreno_dev); \
preempt_enable(); \
local_irq_restore(_flags); \
} \
} while (0);\
})
/*
* ADRENO_FEATURE - return true if the specified feature is supported by the GPU
* core
*/
#define ADRENO_FEATURE(_dev, _bit) \
(((_dev)->gpucore->features_standard && \
of_device_is_compatible((_dev)->dev.pdev->dev.of_node, "qcom,adreno")) \
? ((_dev)->gpucore->features_standard & (_bit)) \
: ((_dev)->gpucore->features & (_bit)))
/**
* ADRENO_QUIRK - return true if the specified quirk is required by the GPU
*/
#define ADRENO_QUIRK(_dev, _bit) \
((_dev)->quirks & (_bit))
#define ADRENO_FW(a, f) (&(a->fw[f]))
/* Adreno core features */
/* The core supports SP/TP hw controlled power collapse */
#define ADRENO_SPTP_PC BIT(0)
/* The GPU supports content protection */
#define ADRENO_CONTENT_PROTECTION BIT(1)
/* The GPU supports preemption */
#define ADRENO_PREEMPTION BIT(2)
/* The GPMU supports Limits Management */
#define ADRENO_LM BIT(3)
/* The GPU supports retention for cpz registers */
#define ADRENO_CPZ_RETENTION BIT(4)
/* The core has soft fault detection available */
#define ADRENO_SOFT_FAULT_DETECT BIT(5)
/* The GMU supports IFPC power management*/
#define ADRENO_IFPC BIT(6)
/* The core supports IO-coherent memory */
#define ADRENO_IOCOHERENT BIT(7)
/*
* The GMU supports Adaptive Clock Distribution (ACD)
* for droop mitigation
*/
#define ADRENO_ACD BIT(8)
/* Cooperative reset enabled GMU */
#define ADRENO_COOP_RESET BIT(9)
/* Indicates that the specific target is no longer supported */
#define ADRENO_DEPRECATED BIT(10)
/* The target supports ringbuffer level APRIV */
#define ADRENO_APRIV BIT(11)
/* The GMU supports Battery Current Limiting */
#define ADRENO_BCL BIT(12)
/* L3 voting is supported with L3 constraints */
#define ADRENO_L3_VOTE BIT(13)
/* LPAC is supported */
#define ADRENO_LPAC BIT(14)
/* Late Stage Reprojection (LSR) enablment for GMU */
#define ADRENO_LSR BIT(15)
/* GMU and kernel supports hardware fences */
#define ADRENO_HW_FENCE BIT(16)
/* Dynamic Mode Switching supported on this target */
#define ADRENO_DMS BIT(17)
/* AQE supported on this target */
#define ADRENO_AQE BIT(18)
/* Warm Boot supported on this target */
#define ADRENO_GMU_WARMBOOT BIT(19)
/* The GPU supports CLX */
#define ADRENO_CLX BIT(20)
/* Enable GMU support for GMU based thermal mitigation */
#define ADRENO_GMU_THERMAL_MITIGATION BIT(21)
/* GMU Based DCVS */
#define ADRENO_GMU_BASED_DCVS BIT(22)
/* RT hint feature for RB0 workloads */
#define ADRENO_RT_HINT BIT(23)
/* Defer allocation of preemption record gmem memory when needed */
#define ADRENO_DEFER_GMEM_ALLOC BIT(24)
/* The GMU supports MINBW voting */
#define ADRENO_GMU_MINBW BIT(25)
/* Enable GMU Based DCVS profile */
#define ADRENO_DCVS_PROFILE BIT(26)
/* Enable TSENSE power savings during sleep */
#define ADRENO_TSENSE_DYNAMIC_PERIOD BIT(27)
/* Enable GMU Based AB voting */
#define ADRENO_GMU_AB BIT(28)
/*
* The target uses the GPU_CX_MISC_SW_FUSE_FREQ_LIMIT_STATUS register to
* get combined (HW + SW) speedbin when no nvmem speed_bin cell exists.
*/
#define ADRENO_SOFTFUSE BIT_ULL(32)
/*
* Adreno GPU quirks - control bits for various workarounds
*/
/* Set TWOPASSUSEWFI in PC_DBG_ECO_CNTL (5XX/6XX) */
#define ADRENO_QUIRK_TWO_PASS_USE_WFI BIT(0)
/* Submit critical packets at GPU wake up */
#define ADRENO_QUIRK_CRITICAL_PACKETS BIT(1)
/* Mask out RB1-3 activity signals from HW hang detection logic */
#define ADRENO_QUIRK_FAULT_DETECT_MASK BIT(2)
/* Disable RB sampler datapath clock gating optimization */
#define ADRENO_QUIRK_DISABLE_RB_DP2CLOCKGATING BIT(3)
/* Disable local memory(LM) feature to avoid corner case error */
#define ADRENO_QUIRK_DISABLE_LMLOADKILL BIT(4)
/* Allow HFI to use registers to send message to GMU */
#define ADRENO_QUIRK_HFI_USE_REG BIT(5)
/* Only set protected SECVID registers once */
#define ADRENO_QUIRK_SECVID_SET_ONCE BIT(6)
/*
* Limit number of read and write transactions from
* UCHE block to GBIF to avoid possible deadlock
* between GBIF, SMMU and MEMNOC.
*/
#define ADRENO_QUIRK_LIMIT_UCHE_GBIF_RW BIT(8)
/* Do explicit mode control of cx gdsc */
#define ADRENO_QUIRK_CX_GDSC BIT(9)
/* Command identifiers */
#define CONTEXT_TO_MEM_IDENTIFIER 0x2EADBEEF
#define CMD_IDENTIFIER 0x2EEDFACE
#define CMD_INTERNAL_IDENTIFIER 0x2EEDD00D
#define START_IB_IDENTIFIER 0x2EADEABE
#define END_IB_IDENTIFIER 0x2ABEDEAD
#define START_PROFILE_IDENTIFIER 0x2DEFADE1
#define END_PROFILE_IDENTIFIER 0x2DEFADE2
#define PWRON_FIXUP_IDENTIFIER 0x2AFAFAFA
/* One cannot wait forever for the core to idle, so set an upper limit to the
* amount of time to wait for the core to go idle
*/
#define ADRENO_IDLE_TIMEOUT (20 * 1000)
#define ADRENO_FW_PFP 0
#define ADRENO_FW_SQE 0
#define ADRENO_FW_PM4 1
#define ADRENO_FW_AQE 1
#define ADRENO_GPUREV_VALUE(_major, _minor, _patchid) (((_major & 0xFF) << 16) | \
((_minor & 0xFF) << 8) | \
(_patchid & 0xFF))
enum adreno_gpurev {
ADRENO_REV_UNKNOWN = 0,
ADRENO_REV_A304 = 304,
ADRENO_REV_A305 = 305,
ADRENO_REV_A305C = 306,
ADRENO_REV_A306 = 307,
ADRENO_REV_A306A = 308,
ADRENO_REV_A310 = 310,
ADRENO_REV_A320 = 320,
ADRENO_REV_A330 = 330,
ADRENO_REV_A305B = 335,
ADRENO_REV_A405 = 405,
ADRENO_REV_A418 = 418,
ADRENO_REV_A420 = 420,
ADRENO_REV_A430 = 430,
ADRENO_REV_A505 = 505,
ADRENO_REV_A506 = 506,
ADRENO_REV_A508 = 508,
ADRENO_REV_A510 = 510,
ADRENO_REV_A512 = 512,
ADRENO_REV_A530 = 530,
ADRENO_REV_A540 = 540,
ADRENO_REV_A610 = 610,
ADRENO_REV_A611 = 611,
ADRENO_REV_A612 = 612,
ADRENO_REV_A615 = 615,
ADRENO_REV_A616 = 616,
ADRENO_REV_A618 = 618,
ADRENO_REV_A619 = 619,
ADRENO_REV_A620 = 620,
ADRENO_REV_A621 = 621,
ADRENO_REV_A622 = 622,
ADRENO_REV_A623 = 623,
ADRENO_REV_A630 = 630,
ADRENO_REV_A640 = 640,
ADRENO_REV_A642 = 642,
ADRENO_REV_A643 = 643,
ADRENO_REV_A650 = 650,
ADRENO_REV_A660 = 660,
ADRENO_REV_A662 = 662,
ADRENO_REV_A663 = 663,
ADRENO_REV_A680 = 680,
ADRENO_REV_A702 = 702,
ADRENO_REV_A704 = 704,
/*
* Version numbers may exceed 1 digit
* Bits 16-23: Major
* Bits 8-15: Minor
* Bits 0-7: Patch id
*/
ADRENO_REV_GEN6_3_26_0 = ADRENO_GPUREV_VALUE(3, 26, 0),
ADRENO_REV_GEN7_0_0 = ADRENO_GPUREV_VALUE(7, 0, 0),
ADRENO_REV_GEN7_0_1 = ADRENO_GPUREV_VALUE(7, 0, 1),
ADRENO_REV_GEN7_2_0 = ADRENO_GPUREV_VALUE(7, 2, 0),
ADRENO_REV_GEN7_2_1 = ADRENO_GPUREV_VALUE(7, 2, 1),
ADRENO_REV_GEN7_3_0 = ADRENO_GPUREV_VALUE(7, 3, 0),
ADRENO_REV_GEN7_4_0 = ADRENO_GPUREV_VALUE(7, 4, 0),
ADRENO_REV_GEN7_5_0 = ADRENO_GPUREV_VALUE(7, 5, 0),
ADRENO_REV_GEN7_6_0 = ADRENO_GPUREV_VALUE(7, 6, 0),
ADRENO_REV_GEN7_9_0 = ADRENO_GPUREV_VALUE(7, 9, 0),
ADRENO_REV_GEN7_9_1 = ADRENO_GPUREV_VALUE(7, 9, 1),
ADRENO_REV_GEN7_14_0 = ADRENO_GPUREV_VALUE(7, 14, 0),
ADRENO_REV_GEN7_11_0 = ADRENO_GPUREV_VALUE(7, 11, 0),
ADRENO_REV_GEN7_15_0 = ADRENO_GPUREV_VALUE(7, 15, 0),
ADRENO_REV_GEN7_17_0 = ADRENO_GPUREV_VALUE(7, 17, 0),
ADRENO_REV_GEN8_0_0 = ADRENO_GPUREV_VALUE(8, 0, 0),
ADRENO_REV_GEN8_0_1 = ADRENO_GPUREV_VALUE(8, 0, 1),
ADRENO_REV_GEN8_1_0 = ADRENO_GPUREV_VALUE(8, 1, 0),
ADRENO_REV_GEN8_2_0 = ADRENO_GPUREV_VALUE(8, 2, 0),
ADRENO_REV_GEN8_2_1 = ADRENO_GPUREV_VALUE(8, 2, 1),
ADRENO_REV_GEN8_3_0 = ADRENO_GPUREV_VALUE(8, 3, 0),
ADRENO_REV_GEN8_4_0 = ADRENO_GPUREV_VALUE(8, 4, 0),
ADRENO_REV_GEN8_5_0 = ADRENO_GPUREV_VALUE(8, 5, 0),
ADRENO_REV_GEN8_6_0 = ADRENO_GPUREV_VALUE(8, 6, 0),
ADRENO_REV_GEN8_8_0 = ADRENO_GPUREV_VALUE(8, 8, 0),
ADRENO_REV_GEN8_9_0 = ADRENO_GPUREV_VALUE(8, 9, 0),
};
#define ADRENO_SOFT_FAULT BIT(0)
#define ADRENO_HARD_FAULT BIT(1)
#define ADRENO_TIMEOUT_FAULT BIT(2)
#define ADRENO_IOMMU_STALL_ON_PAGE_FAULT BIT(3)
#define ADRENO_PREEMPT_FAULT BIT(4)
#define ADRENO_GMU_FAULT BIT(5)
#define ADRENO_CTX_DETATCH_TIMEOUT_FAULT BIT(6)
#define ADRENO_GMU_FAULT_SKIP_SNAPSHOT BIT(7)
#define ADRENO_FAULT_TYPES 8
/**
* Bit fields for GPU_CX_MISC_CX_AHB_*_CNTL registers
* AHB_TXFRTIMEOUTRELEASE [8:8]
* AHB_TXFRTIMEOUTENABLE [9:9]
* AHB_RESPONDERROR [11:11]
* AHB_ERRORSTATUSENABLE [12:12]
*/
#define ADRENO_AHB_CNTL_DEFAULT (BIT(12) | BIT(11) | BIT(9) | BIT(8))
enum adreno_pipe_type {
PIPE_NONE = 0,
PIPE_BR = 1,
PIPE_BV = 2,
PIPE_LPAC = 3,
PIPE_AQE0 = 4,
PIPE_AQE1 = 5,
PIPE_DDE_BR = 6,
PIPE_DDE_BV = 7,
};
/* number of throttle counters for DCVS adjustment */
#define ADRENO_GPMU_THROTTLE_COUNTERS 4
struct adreno_gpudev;
/* Time to allow preemption to complete (in ms) */
#define ADRENO_PREEMPT_TIMEOUT 10000
#define PREEMPT_SCRATCH_OFFSET(id) (id * sizeof(u64))
#define PREEMPT_SCRATCH_ADDR(dev, id) \
((dev)->preempt.scratch->gpuaddr + PREEMPT_SCRATCH_OFFSET(id))
/**
* enum adreno_preempt_states
* ADRENO_PREEMPT_NONE: No preemption is scheduled
* ADRENO_PREEMPT_START: The S/W has started
* ADRENO_PREEMPT_TRIGGERED: A preeempt has been triggered in the HW
* ADRENO_PREEMPT_FAULTED: The preempt timer has fired
* ADRENO_PREEMPT_PENDING: The H/W has signaled preemption complete
* ADRENO_PREEMPT_COMPLETE: Preemption could not be finished in the IRQ handler,
* worker has been scheduled
*/
enum adreno_preempt_states {
ADRENO_PREEMPT_NONE = 0,
ADRENO_PREEMPT_START,
ADRENO_PREEMPT_TRIGGERED,
ADRENO_PREEMPT_FAULTED,
ADRENO_PREEMPT_PENDING,
ADRENO_PREEMPT_COMPLETE,
};
/**
* struct adreno_protected_regs - container for a protect register span
*/
struct adreno_protected_regs {
/** @reg: Physical protected mode register to write to */
u32 reg;
/** @start: Dword offset of the starting register in the range */
u32 start;
/**
* @end: Dword offset of the ending register in the range
* (inclusive)
*/
u32 end;
/**
* @noaccess: 1 if the register should not be accessible from
* userspace, 0 if it can be read (but not written)
*/
u32 noaccess;
};
/**
* struct adreno_preemption
* @state: The current state of preemption
* @scratch: Per-target scratch memory for implementation specific functionality
* @timer: A timer to make sure preemption doesn't stall
* @work: A work struct for the preemption worker (for 5XX)
* preempt_level: The level of preemption (for 6XX)
* skipsaverestore: To skip saverestore during L1 preemption (for 6XX)
* usesgmem: enable GMEM save/restore across preemption (for 6XX)
* count: Track the number of preemptions triggered
*/
struct adreno_preemption {
atomic_t state;
struct kgsl_memdesc *scratch;
struct timer_list timer;
struct work_struct work;
unsigned int preempt_level;
bool skipsaverestore;
bool usesgmem;
unsigned int count;
/* @postamble_len: Number of dwords in KMD postamble pm4 packet */
u32 postamble_len;
/*
* @postamble_bootup_len: Number of dwords in KMD postamble pm4 packet
* that needs to be sent before first submission to GPU.
* Note: Postambles are not preserved across slumber.
*/
u32 postamble_bootup_len;
};
struct adreno_busy_data {
unsigned int gpu_busy;
unsigned int bif_ram_cycles;
unsigned int bif_ram_cycles_read_ch1;
unsigned int bif_ram_cycles_write_ch0;
unsigned int bif_ram_cycles_write_ch1;
unsigned int bif_starved_ram;
unsigned int bif_starved_ram_ch1;
unsigned int num_ifpc;
unsigned int throttle_cycles[ADRENO_GPMU_THROTTLE_COUNTERS];
u32 bcl_throttle;
};
/**
* struct adreno_firmware - Struct holding fw details
* @fwvirt: Buffer which holds the ucode
* @size: Size of ucode buffer
* @version: Version of ucode
* @memdesc: Memory descriptor which holds ucode buffer info
*/
struct adreno_firmware {
unsigned int *fwvirt;
size_t size;
unsigned int version;
struct kgsl_memdesc *memdesc;
};
/**
* struct adreno_perfcounter_list_node - struct to store perfcounters
* allocated by a process on a kgsl fd.
* @groupid: groupid of the allocated perfcounter
* @countable: countable assigned to the allocated perfcounter
* @node: list node for perfcounter_list of a process
*/
struct adreno_perfcounter_list_node {
unsigned int groupid;
unsigned int countable;
struct list_head node;
};
/**
* struct adreno_device_private - Adreno private structure per fd
* @dev_priv: the kgsl device private structure
* @perfcounter_list: list of perfcounters used by the process
*/
struct adreno_device_private {
struct kgsl_device_private dev_priv;
struct list_head perfcounter_list;
};
/**
* struct adreno_reglist_list - A container for list of registers and
* number of registers in the list
*/
struct adreno_reglist_list {
/** @reg: List of register **/
const u32 *regs;
/** @count: Number of registers in the list **/
u32 count;
};
/**
* struct adreno_power_ops - Container for target specific power up/down
* sequences
*/
struct adreno_power_ops {
/**
* @first_open: Target specific function triggered when first kgsl
* instance is opened
*/
int (*first_open)(struct adreno_device *adreno_dev);
/**
* @last_close: Target specific function triggered when last kgsl
* instance is closed
*/
int (*last_close)(struct adreno_device *adreno_dev);
/**
* @active_count_get: Target specific function to keep gpu from power
* collapsing
*/
int (*active_count_get)(struct adreno_device *adreno_dev);
/** @pm_suspend: Target specific function to suspend the driver */
int (*pm_suspend)(struct adreno_device *adreno_dev);
/** @pm_resume: Target specific function to resume the driver */
void (*pm_resume)(struct adreno_device *adreno_dev);
/**
* @touch_wakeup: Target specific function to start gpu on touch event
*/
void (*touch_wakeup)(struct adreno_device *adreno_dev);
/** @gpu_clock_set: Target specific function to set gpu frequency */
int (*gpu_clock_set)(struct adreno_device *adreno_dev, u32 pwrlevel);
/** @gpu_bus_set: Target specific function to set gpu bandwidth */
int (*gpu_bus_set)(struct adreno_device *adreno_dev, int bus_level,
u32 ab);
/** @gmu_based_dcvs_pwr_ops: Function ops for GMU based DCVS power operations */
void (*gmu_based_dcvs_pwr_ops)(struct adreno_device *adreno_dev, u32 arg,
enum gpu_pwrlevel_op op);
/** @set_thermal_index: Function ops for sending thermal constraint to GMU */
void (*set_thermal_index)(struct adreno_device *adreno_dev);
};
struct adreno_ubwc_props {
/** @mode: UBWC mode value */
u32 mode;
/** @mode2: Secondary UBWC mode (Gen8 only) */
u32 mode2;
/** @level2_swizzling_dis: Level 2 swizzling disable (Gen6 only) */
u32 level2_swizzling_dis;
/** @amsbc: AMSBC enable flag */
bool amsbc;
/** @rgb565_predicator: RGB565 predictor enable */
bool rgb565_predicator;
/** @yuvnotcomptofc: YUV not compressed to FC (Gen8 only) */
bool yuvnotcomptofc;
/** @fp16compoptdis: FP16 compression optimization disable (Gen8 only) */
bool fp16compoptdis;
/** @rgba8888_lossless: RGBA8888 lossless mode (Gen8 only) */
bool rgba8888_lossless;
};
/**
* struct adreno_gpu_core - A specific GPU core definition
* @gpurev: Unique GPU revision identifier
* @core: Match for the core version of the GPU
* @major: Match for the major version of the GPU
* @minor: Match for the minor version of the GPU
* @patchid: Match for the patch revision of the GPU
* @features: Common adreno features supported by this core
* @gpudev: Pointer to the GPU family specific functions for this core
* @uche_gmem_alignment: Alignment required for UCHE GMEM base
* @gmem_size: Amount of binning memory (GMEM/OCMEM) to reserve for the core
* @bus_width: Bytes transferred in 1 cycle
*/
struct adreno_gpu_core {
enum adreno_gpurev gpurev;
unsigned int core, major, minor, patchid;
/**
* @compatible: If specified, use the compatible string to match the
* device
*/
const char *compatible;
u64 features;
/** @features_standard: Features only supported on standard kernel */
u64 features_standard;
const struct adreno_gpudev *gpudev;
const struct adreno_perfcounters *perfcounters;
u32 uche_gmem_alignment;
size_t gmem_size;
u32 bus_width;
/** @snapshot_size: Size of the static snapshot region in bytes */
u32 snapshot_size;
/** @num_ddr_channels: Number of DDR channels */
u32 num_ddr_channels;
/**
* @chipid: Optional GPU chip ID for publically released chipsets; required when
* using standard devicetree bindings.
*/
u32 chipid;
/**
* @speedbins: Optional table of fuse to speedbin mappings
*
* Consists of pairs of fuse, index mappings, terminated with
* {SHRT_MAX, 0} sentinel.
*/
struct kgsl_speedbin *speedbins;
/** @ubwc_mode: Supported UBWC mode */
u32 ubwc_mode;
/** @mal: Minimum access length */
u32 mal;
/** @highest_bank_bit: The bit of the highest DDR bank */
u32 highest_bank_bit;
/** @gpu_model: Gpu model name */
const char *gpu_model;
};
/**
* struct adreno_dispatch_ops - Common functions for dispatcher operations
*/
struct adreno_dispatch_ops {
/* @close: Shut down the dispatcher */
void (*close)(struct adreno_device *adreno_dev);
/* @queue_cmds: Queue a command on the context */
int (*queue_cmds)(struct kgsl_device_private *dev_priv,
struct kgsl_context *context, struct kgsl_drawobj *drawobj[],
u32 count, u32 *timestamp);
/* @queue_context: Queue a context to be dispatched */
void (*queue_context)(struct adreno_device *adreno_dev,
struct adreno_context *drawctxt);
int (*setup_context)(struct adreno_device *adreno_dev,
struct adreno_context *drawctxt);
/* @create_hw_fence: Create a hardware fence */
void (*create_hw_fence)(struct adreno_device *adreno_dev, struct kgsl_sync_fence *kfence);
};
/**
* struct adreno_fault_proc - Structure to hold data on faulting processes
*/
struct adreno_fault_proc {
/** @comm: Task name of the faulting process */
char comm[TASK_COMM_LEN];
/** @fault_count: Count of the GPU faults from this process */
u32 fault_count;
};
#define ADRENO_MAX_FAULTING_PROCS 10
/**
* struct adreno_device - The mothership structure for all adreno related info
* @dev: Reference to struct kgsl_device
* @priv: Holds the private flags specific to the adreno_device
* @chipid: Chip ID specific to the GPU
* @gpucore: Pointer to the adreno_gpu_core structure
* @gpmu_cmds_size: Length of gpmu cmd stream
* @gpmu_cmds: gpmu cmd stream
* @ringbuffers: Array of pointers to adreno_ringbuffers
* @num_ringbuffers: Number of ringbuffers for the GPU
* @cur_rb: Pointer to the current ringbuffer
* @next_rb: Ringbuffer we are switching to during preemption
* @prev_rb: Ringbuffer we are switching from during preemption
* @ft_policy: Defines the fault tolerance policy
* @long_ib_detect: Long IB detection availability
* @cooperative_reset: Indicates if graceful death handshake is enabled
* between GMU and GPU
* @profile: Container for adreno profiler information
* @dispatcher: Container for adreno GPU dispatcher
* @pwron_fixup: Command buffer to run a post-power collapse shader workaround
* @pwron_fixup_dwords: Number of dwords in the command buffer
* @input_work: Work struct for turning on the GPU after a touch event
* @busy_data: Struct holding GPU VBIF busy stats
* @ram_cycles_lo: Number of DDR clock cycles for the monitor session (Only
* DDR channel 0 read cycles in case of GBIF)
* @ram_cycles_lo_ch1_read: Number of DDR channel 1 Read clock cycles for
* the monitor session
* @ram_cycles_lo_ch0_write: Number of DDR channel 0 Write clock cycles for
* the monitor session
* @ram_cycles_lo_ch1_write: Number of DDR channel 0 Write clock cycles for
* the monitor session
* @starved_ram_lo: Number of cycles VBIF/GBIF is stalled by DDR (Only channel 0
* stall cycles in case of GBIF)
* @starved_ram_lo_ch1: Number of cycles GBIF is stalled by DDR channel 1
* @halt: Atomic variable to check whether the GPU is currently halted
* @pending_irq_refcnt: Atomic variable to keep track of running IRQ handlers
* @ctx_d_debugfs: Context debugfs node
* @profile_buffer: Memdesc holding the drawobj profiling buffer
* @profile_index: Index to store the start/stop ticks in the profiling
* buffer
* @pwrup_reglist: Memdesc holding the power up register list
* which is used by CP during preemption and IFPC
* @lm_sequence: Pointer to the start of the register write sequence for LM
* @lm_size: The dword size of the LM sequence
* @lm_limit: limiting value for LM
* @lm_threshold_count: register value for counter for lm threshold breakin
* @lm_threshold_cross: number of current peaks exceeding threshold
* @ifpc_count: Number of times the GPU went into IFPC
* @highest_bank_bit: Value of the highest bank bit
* @gpmu_throttle_counters - counters for number of throttled clocks
* @irq_storm_work: Worker to handle possible interrupt storms
* @active_list: List to track active contexts
* @active_list_lock: Lock to protect active_list
* @gpu_llc_slice: GPU system cache slice descriptor
* @gpu_llc_slice_enable: To enable the GPU system cache slice or not
* @gpuhtw_llc_slice: GPU pagetables system cache slice descriptor
* @gpuhtw_llc_slice_enable: To enable the GPUHTW system cache slice or not
* @gpumv_llc_slice: GPU MV buffer system cache slice descriptor
* @gpumv_llc_slice_enable: To enable GPUMV buffer system cache slice or not
* @zap_loaded: Used to track if zap was successfully loaded or not
*/
struct adreno_device {
struct kgsl_device dev; /* Must be first field in this struct */
unsigned long priv;
unsigned int chipid;
/** @uche_gmem_base: Base address of GMEM for UCHE access */
u64 uche_gmem_base;
const struct adreno_gpu_core *gpucore;
struct adreno_firmware fw[2];
size_t gpmu_cmds_size;
unsigned int *gpmu_cmds;
struct adreno_ringbuffer ringbuffers[KGSL_PRIORITY_MAX_RB_LEVELS];
int num_ringbuffers;
struct adreno_ringbuffer *cur_rb;
struct adreno_ringbuffer *next_rb;
struct adreno_ringbuffer *prev_rb;
unsigned long ft_policy;
bool long_ib_detect;
bool cooperative_reset;
struct adreno_profile profile;
struct adreno_dispatcher dispatcher;
struct kgsl_memdesc *pwron_fixup;
unsigned int pwron_fixup_dwords;
struct work_struct input_work;
struct adreno_busy_data busy_data;
unsigned int ram_cycles_lo;
unsigned int ram_cycles_lo_ch1_read;
unsigned int ram_cycles_lo_ch0_write;
unsigned int ram_cycles_lo_ch1_write;
unsigned int starved_ram_lo;
unsigned int starved_ram_lo_ch1;
atomic_t halt;
atomic_t pending_irq_refcnt;
struct dentry *ctx_d_debugfs;
/** @lm_enabled: True if limits management is enabled for this target */
bool lm_enabled;
/** @acd_enabled: True if acd is enabled for this target */
bool acd_enabled;
/** @hwcg_enabled: True if hardware clock gating is enabled */
bool hwcg_enabled;
/** @throttling_enabled: True if LM throttling is enabled on a5xx */
bool throttling_enabled;
/** @sptp_pc_enabled: True if SPTP power collapse is enabled on a5xx */
bool sptp_pc_enabled;
/** @bcl_enabled: True if BCL is enabled */
bool bcl_enabled;
/** @clx_enabled: True if CLX is enabled */
bool clx_enabled;
/** @isense_reg_mapped: True if isense registers are mapped to regmap */
bool isense_reg_mapped;
/** @lpac_enabled: True if LPAC is enabled */
bool lpac_enabled;
/** @dms_enabled: True if DMS is enabled */
bool dms_enabled;
/** @minbw_enabled: True if minbw vote is enabled */
bool minbw_enabled;
/** @preempt_override: True if command line param enables preemption */
bool preempt_override;
struct kgsl_memdesc *profile_buffer;
unsigned int profile_index;
struct kgsl_memdesc *pwrup_reglist;
uint32_t *lm_sequence;
uint32_t lm_size;
struct adreno_preemption preempt;
struct work_struct gpmu_work;
uint32_t lm_leakage;
uint32_t lm_limit;
uint32_t lm_threshold_count;
uint32_t lm_threshold_cross;
uint32_t ifpc_count;
unsigned int highest_bank_bit;
/** @ubwc_mode: Supported UBWC mode */
u32 ubwc_mode;
/** @mal: Minimum access length */
u32 mal;
unsigned int quirks;
#ifdef CONFIG_QCOM_KGSL_CORESIGHT
/** @gx_coresight: A coresight instance for GX */
struct adreno_coresight_device gx_coresight;
/** @gx_coresight: A coresight instance for CX */
struct adreno_coresight_device cx_coresight;
/** @funnel_gfx: A coresight instance for gfx funnel */
struct adreno_funnel_device funnel_gfx;
/**
* @coresight_en_cnt: Retain mask if either coresight-gfx
* or coresight-gfx-cx is enabled; remove only when both
* are disabled
*/
u32 coresight_en_cnt;
#endif
uint32_t gpmu_throttle_counters[ADRENO_GPMU_THROTTLE_COUNTERS];
struct work_struct irq_storm_work;
struct list_head active_list;
spinlock_t active_list_lock;
void *gpu_llc_slice;
bool gpu_llc_slice_enable;
void *gpuhtw_llc_slice;
bool gpuhtw_llc_slice_enable;
void *gpumv_llc_slice;
bool gpumv_llc_slice_enable;
unsigned int zap_loaded;
/**
* @critpkts: Memory descriptor for 5xx critical packets if applicable
*/
struct kgsl_memdesc *critpkts;
/**
* @critpkts: Memory descriptor for 5xx secure critical packets
*/
struct kgsl_memdesc *critpkts_secure;
/** @irq_mask: The current interrupt mask for the GPU device */
u32 irq_mask;
/* @dispatch_ops: A pointer to a set of adreno dispatch ops */
const struct adreno_dispatch_ops *dispatch_ops;
/** @hwsched: Container for the hardware dispatcher */
struct adreno_hwsched hwsched;
/*
* @perfcounter: Flag to clear perfcounters across contexts and
* controls perfcounter ioctl read
*/
bool perfcounter;
/** @gmu_hub_clk_freq: Gmu hub interface clock frequency */
u64 gmu_hub_clk_freq;
/* @patch_reglist: If false power up register list needs to be patched */
bool patch_reglist;
/*
* @uche_client_pf: uche_client_pf client register configuration
* for pf debugging
*/
u32 uche_client_pf;
/**
* @bcl_data: bit 0 contains response type for bcl alarms and bits 1:24 controls
* throttle level for bcl alarm levels 0-2. If not set, gmu fw sets default throttle levels.
*/
u32 bcl_data;
/* @minbw_data: Min bw level to vote for when entering ifpc */
u32 minbw_data;
/*
* @bcl_debugfs_dir: Debugfs directory node for bcl related nodes
*/
struct dentry *bcl_debugfs_dir;
/** @bcl_throttle_time_us: Total time in us spent in BCL throttling */
u32 bcl_throttle_time_us;
/* @preemption_debugfs_dir: Debugfs directory node for preemption related nodes */
struct dentry *preemption_debugfs_dir;
/* @hwsched_enabled: If true, hwsched is enabled */
bool hwsched_enabled;
/* @fastblend_enabled: True if fastblend feature is enabled */
bool fastblend_enabled;
/* @raytracing_enabled: True if raytracing feature is enabled */
bool raytracing_enabled;
/* @feature_fuse: feature fuse value read from HW */
u32 feature_fuse;
/** @gmu_ab: Track if GMU supports ab vote */
bool gmu_ab;
/** @ifpc_hyst: IFPC long hysteresis value */
u32 ifpc_hyst;
/** @ifpc_hyst_floor: IFPC long hysteresis floor value */
u32 ifpc_hyst_floor;
/*
* @no_restore_count: Keep track of perfcounter requests that don't have
* ADRENO_PERFCOUNTER_GROUP_RESTORE flag set
*/
u32 no_restore_count;
/*
* @ahb_timeout_val: AHB transaction timeout value.
* If set, a timeout will occur in 2 ^ (ahb_timeout_val + 1) cycles.
*/
u32 ahb_timeout_val;
/** @fault_counts: Keep track of GPU faults */
u32 fault_counts[ADRENO_FAULT_TYPES];
/**
* @fault_procs: Array to keep track of per process GPU fault count sorted by the number
* of GPU faults
*/
struct adreno_fault_proc fault_procs[ADRENO_MAX_FAULTING_PROCS];
/** @fault_stats_lock: A R/W lock to protect GPU fault statistics */
rwlock_t fault_stats_lock;
/** @fault_recovery_mutex: Mutex taken during fault handling in the dispatcher */
struct mutex fault_recovery_mutex;
/** @pm_nb: Notifier block for defining a callback that gets called during system suspend */
struct notifier_block pm_nb;
/** @suspend_recovery_gate: Gate to wait on for system to come out of suspend */
struct completion suspend_recovery_gate;
/** @scheduler_worker: kthread worker for scheduling gpu commands */
struct kthread_worker *scheduler_worker;
/** @scheduler_work: work_struct to put the gpu command scheduler in a work queue */
struct kthread_work scheduler_work;
/** @scheduler_fault: Atomic to trigger scheduler based fault recovery */
atomic_t scheduler_fault;
/** @dcvs_tuning_mutex: Mutex taken during dcvs tuning */
struct mutex dcvs_tuning_mutex;
/** @dcvs_tuning_mingap_lvl: Current DCVS tuning level for mingap */
u32 dcvs_tuning_mingap_lvl;
/** @dcvs_tuning_penalty_lvl: Current DCVS tuning level for penalty */
u32 dcvs_tuning_penalty_lvl;
/** @dcvs_tuning_numbusy_lvl: Current DCVS tuning level for numbusy */
u32 dcvs_tuning_numbusy_lvl;
/** @total_ctxt_record_sz: Size of the total preemption record in bytes */
u64 total_ctxt_record_sz;
/** @dcvs_profile_enabled: True if DCVS profile is enabled */
bool dcvs_profile_enabled;
/** @aqe_ctxt_record_sz: Size of the AQE section in preemption record in bytes */
u64 aqe_ctxt_record_sz;
/** @ubwc_cfg: Pointer to hold struct qcom_ubwc_cfg_data fetched from
* qcom_ubwc_config_get_data() API
*/
void *ubwc_cfg_data;
/** @adreno_ubwc_props: Container of all UBWC props required to program NC_MODE_CNTL
* registers
*/
struct adreno_ubwc_props ubwc_props;
};
/* Time to wait for suspend recovery gate to complete */
#define ADRENO_SUSPEND_RECOVERY_GATE_TIMEOUT_MS 5000
/**
* enum adreno_device_flags - Private flags for the adreno_device
* @ADRENO_DEVICE_PWRON - Set during init after a power collapse
* @ADRENO_DEVICE_PWRON_FIXUP - Set if the target requires the shader fixup
* after power collapse
* @ADRENO_DEVICE_STARTED - Set if the device start sequence is in progress
* @ADRENO_DEVICE_FAULT - Set if the device is currently in fault (and shouldn't
* send any more commands to the ringbuffer)
* @ADRENO_DEVICE_DRAWOBJ_PROFILE - Set if the device supports drawobj
* profiling via the ALWAYSON counter
* @ADRENO_DEVICE_PREEMPTION - Turn on/off preemption
* @ADRENO_DEVICE_SOFT_FAULT_DETECT - Set if soft fault detect is enabled
* @ADRENO_DEVICE_GPMU_INITIALIZED - Set if GPMU firmware initialization succeed
* @ADRENO_DEVICE_ISDB_ENABLED - Set if the Integrated Shader DeBugger is
* attached and enabled
* @ADRENO_DEVICE_CACHE_FLUSH_TS_SUSPENDED - Set if a CACHE_FLUSH_TS irq storm
* is in progress
*/
enum adreno_device_flags {
ADRENO_DEVICE_PWRON = 0,
ADRENO_DEVICE_PWRON_FIXUP = 1,
ADRENO_DEVICE_INITIALIZED = 2,
ADRENO_DEVICE_STARTED = 5,
ADRENO_DEVICE_FAULT = 6,
ADRENO_DEVICE_DRAWOBJ_PROFILE = 7,
ADRENO_DEVICE_GPU_REGULATOR_ENABLED = 8,
ADRENO_DEVICE_PREEMPTION = 9,
ADRENO_DEVICE_SOFT_FAULT_DETECT = 10,
ADRENO_DEVICE_GPMU_INITIALIZED = 11,
ADRENO_DEVICE_ISDB_ENABLED = 12,
ADRENO_DEVICE_CACHE_FLUSH_TS_SUSPENDED = 13,
/** @ADRENO_DEVICE_DMS: Set if DMS is enabled */
ADRENO_DEVICE_DMS = 14,
/** @ADRENO_DEVICE_GMU_AB: Set if AB vote via GMU is enabled */
ADRENO_DEVICE_GMU_AB = 15,
/** @ADRENO_DEVICE_CX_TIMER_INITIALIZED: Set if the CX timer is initialized */
ADRENO_DEVICE_CX_TIMER_INITIALIZED = 17,
/** @ADRENO_DEVICE_RESET_RECOVERY: Set if the ADRENO device under goes reset recovery */
ADRENO_DEVICE_RESET_RECOVERY = 18,
/** @ADRENO_DEVICE_FIRST_BOOT_DONE: Set if the ADRENO device first boot is done */
ADRENO_DEVICE_FIRST_BOOT_DONE = 19,
};
/**
* struct adreno_drawobj_profile_entry - a single drawobj entry in the
* kernel profiling buffer
* @started: Number of GPU ticks at start of the drawobj
* @retired: Number of GPU ticks at the end of the drawobj
* @ctx_start: CP_ALWAYS_ON_CONTEXT tick at start of the drawobj
* @ctx_end: CP_ALWAYS_ON_CONTEXT tick at end of the drawobj
*/
struct adreno_drawobj_profile_entry {
uint64_t started;
uint64_t retired;
uint64_t ctx_start;
uint64_t ctx_end;
};
#define ADRENO_DRAWOBJ_PROFILE_OFFSET(_index, _member) \
((_index) * sizeof(struct adreno_drawobj_profile_entry) \
+ offsetof(struct adreno_drawobj_profile_entry, _member))
/**
* struct adreno_submit_time - utility structure to store the wall clock / GPU
* ticks at command submit time
* @ticks: GPU ticks at submit time (from the 19.2Mhz timer)
* @ktime: local clock time (in nanoseconds)
* @utime: Wall clock time
* @drawobj: the object that we want to profile
*/
struct adreno_submit_time {
u64 ticks;