Skip to content

Commit

Permalink
qcom set power to max (tinygrad#6578)
Browse files Browse the repository at this point in the history
  • Loading branch information
nimlgen authored Sep 18, 2024
1 parent bd40a26 commit 5a7cb8d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tinygrad/runtime/ops_qcom.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,10 @@ def _ctx_create(self):
cr = kgsl.IOCTL_KGSL_DRAWCTXT_CREATE(self.fd, flags=(kgsl.KGSL_CONTEXT_TYPE(kgsl.KGSL_CONTEXT_TYPE_CL) | kgsl.KGSL_CONTEXT_PREAMBLE |
kgsl.KGSL_CONTEXT_NO_GMEM_ALLOC | kgsl.KGSL_CONTEXT_NO_FAULT_TOLERANCE |
kgsl.KGSL_CONTEXT_PREEMPT_STYLE(kgsl.KGSL_CONTEXT_PREEMPT_STYLE_FINEGRAIN)))

# Set power to maximum.
struct.pack_into('IIQQ', pwr:=memoryview(bytearray(0x18)), 0, 1, cr.drawctxt_id, mv_address(_:=memoryview(array.array('I', [1]))), 4)
kgsl.IOCTL_KGSL_SETPROPERTY(self.fd, type=kgsl.KGSL_PROP_PWR_CONSTRAINT, value=mv_address(pwr), sizebytes=pwr.nbytes)
return cr.drawctxt_id

def _info(self):
Expand Down

0 comments on commit 5a7cb8d

Please sign in to comment.