void kgsl_pre_hwaccess(struct kgsl_device *device) { BUG_ON(!mutex_is_locked(&device->mutex)); switch (device->state) { case KGSL_STATE_ACTIVE: return; case KGSL_STATE_NAP: case KGSL_STATE_SLEEP: case KGSL_STATE_SLUMBER: kgsl_pwrctrl_wake(device); break; case KGSL_STATE_SUSPEND: kgsl_check_suspended(device); break; case KGSL_STATE_INIT: case KGSL_STATE_HUNG: case KGSL_STATE_DUMP_AND_RECOVER: if (test_bit(KGSL_PWRFLAGS_CLK_ON, &device->pwrctrl.power_flags)) break; else KGSL_PWR_ERR(device, "hw access while clocks off from state %d\n", device->state); break; default: KGSL_PWR_ERR(device, "hw access while in unknown state %d\n", device->state); break; } }
void kgsl_pre_hwaccess(struct kgsl_device *device) { BUG_ON(!mutex_is_locked(&device->mutex)); if (device->state & (KGSL_STATE_SLEEP | KGSL_STATE_NAP | KGSL_STATE_SLUMBER)) kgsl_pwrctrl_wake(device); }
void kgsl_check_suspended(struct kgsl_device *device) { if (device->requested_state == KGSL_STATE_SUSPEND || device->state == KGSL_STATE_SUSPEND) { mutex_unlock(&device->mutex); wait_for_completion(&device->hwaccess_gate); mutex_lock(&device->mutex); } else if (device->state == KGSL_STATE_DUMP_AND_RECOVER) { mutex_unlock(&device->mutex); wait_for_completion(&device->recovery_gate); mutex_lock(&device->mutex); } else if (device->state == KGSL_STATE_SLUMBER) kgsl_pwrctrl_wake(device); }
void kgsl_pre_hwaccess(struct kgsl_device *device) { if (device->state & (KGSL_STATE_SLEEP | KGSL_STATE_NAP)) kgsl_pwrctrl_wake(device); }