Lines Matching refs:task
75 struct uvesafb_ktask *task; in uvesafb_cn_callback() local
84 task = uvfb_tasks[msg->seq]; in uvesafb_cn_callback()
86 if (!task || msg->ack != task->ack) { in uvesafb_cn_callback()
94 if (task->t.buf_len < utask->buf_len || in uvesafb_cn_callback()
103 memcpy(&task->t, utask, sizeof(*utask)); in uvesafb_cn_callback()
105 if (task->t.buf_len && task->buf) in uvesafb_cn_callback()
106 memcpy(task->buf, utask + 1, task->t.buf_len); in uvesafb_cn_callback()
108 complete(task->done); in uvesafb_cn_callback()
144 static int uvesafb_exec(struct uvesafb_ktask *task) in uvesafb_exec() argument
149 int len = sizeof(task->t) + task->t.buf_len; in uvesafb_exec()
165 init_completion(task->done); in uvesafb_exec()
173 memcpy(m + 1, &task->t, sizeof(task->t)); in uvesafb_exec()
176 memcpy((u8 *)(m + 1) + sizeof(task->t), task->buf, task->t.buf_len); in uvesafb_exec()
182 task->ack = m->ack; in uvesafb_exec()
194 uvfb_tasks[seq] = task; in uvesafb_exec()
216 if (!err && !(task->t.flags & TF_EXIT)) in uvesafb_exec()
217 err = !wait_for_completion_timeout(task->done, in uvesafb_exec()
235 static void uvesafb_free(struct uvesafb_ktask *task) in uvesafb_free() argument
237 if (task) { in uvesafb_free()
238 kfree(task->done); in uvesafb_free()
239 kfree(task); in uvesafb_free()
246 static void uvesafb_reset(struct uvesafb_ktask *task) in uvesafb_reset() argument
248 struct completion *cpl = task->done; in uvesafb_reset()
250 memset(task, 0, sizeof(*task)); in uvesafb_reset()
251 task->done = cpl; in uvesafb_reset()
259 struct uvesafb_ktask *task; in uvesafb_prep() local
261 task = kzalloc(sizeof(*task), GFP_KERNEL); in uvesafb_prep()
262 if (task) { in uvesafb_prep()
263 task->done = kzalloc(sizeof(*task->done), GFP_KERNEL); in uvesafb_prep()
264 if (!task->done) { in uvesafb_prep()
265 kfree(task); in uvesafb_prep()
266 task = NULL; in uvesafb_prep()
269 return task; in uvesafb_prep()
354 struct uvesafb_ktask *task; in uvesafb_vbe_state_save() local
365 task = uvesafb_prep(); in uvesafb_vbe_state_save()
366 if (!task) { in uvesafb_vbe_state_save()
371 task->t.regs.eax = 0x4f04; in uvesafb_vbe_state_save()
372 task->t.regs.ecx = 0x000f; in uvesafb_vbe_state_save()
373 task->t.regs.edx = 0x0001; in uvesafb_vbe_state_save()
374 task->t.flags = TF_BUF_RET | TF_BUF_ESBX; in uvesafb_vbe_state_save()
375 task->t.buf_len = par->vbe_state_size; in uvesafb_vbe_state_save()
376 task->buf = state; in uvesafb_vbe_state_save()
377 err = uvesafb_exec(task); in uvesafb_vbe_state_save()
379 if (err || (task->t.regs.eax & 0xffff) != 0x004f) { in uvesafb_vbe_state_save()
381 task->t.regs.eax, err); in uvesafb_vbe_state_save()
386 uvesafb_free(task); in uvesafb_vbe_state_save()
392 struct uvesafb_ktask *task; in uvesafb_vbe_state_restore() local
398 task = uvesafb_prep(); in uvesafb_vbe_state_restore()
399 if (!task) in uvesafb_vbe_state_restore()
402 task->t.regs.eax = 0x4f04; in uvesafb_vbe_state_restore()
403 task->t.regs.ecx = 0x000f; in uvesafb_vbe_state_restore()
404 task->t.regs.edx = 0x0002; in uvesafb_vbe_state_restore()
405 task->t.buf_len = par->vbe_state_size; in uvesafb_vbe_state_restore()
406 task->t.flags = TF_BUF_ESBX; in uvesafb_vbe_state_restore()
407 task->buf = state_buf; in uvesafb_vbe_state_restore()
409 err = uvesafb_exec(task); in uvesafb_vbe_state_restore()
410 if (err || (task->t.regs.eax & 0xffff) != 0x004f) in uvesafb_vbe_state_restore()
412 task->t.regs.eax, err); in uvesafb_vbe_state_restore()
414 uvesafb_free(task); in uvesafb_vbe_state_restore()
417 static int uvesafb_vbe_getinfo(struct uvesafb_ktask *task, in uvesafb_vbe_getinfo() argument
422 task->t.regs.eax = 0x4f00; in uvesafb_vbe_getinfo()
423 task->t.flags = TF_VBEIB; in uvesafb_vbe_getinfo()
424 task->t.buf_len = sizeof(struct vbe_ib); in uvesafb_vbe_getinfo()
425 task->buf = &par->vbe_ib; in uvesafb_vbe_getinfo()
428 err = uvesafb_exec(task); in uvesafb_vbe_getinfo()
429 if (err || (task->t.regs.eax & 0xffff) != 0x004f) { in uvesafb_vbe_getinfo()
431 (u32)task->t.regs.eax, err); in uvesafb_vbe_getinfo()
454 ((char *)task->buf) + par->vbe_ib.oem_vendor_name_ptr); in uvesafb_vbe_getinfo()
458 ((char *)task->buf) + par->vbe_ib.oem_product_name_ptr); in uvesafb_vbe_getinfo()
462 ((char *)task->buf) + par->vbe_ib.oem_product_rev_ptr); in uvesafb_vbe_getinfo()
466 ((char *)task->buf) + par->vbe_ib.oem_string_ptr); in uvesafb_vbe_getinfo()
475 static int uvesafb_vbe_getmodes(struct uvesafb_ktask *task, in uvesafb_vbe_getmodes() argument
501 uvesafb_reset(task); in uvesafb_vbe_getmodes()
502 task->t.regs.eax = 0x4f01; in uvesafb_vbe_getmodes()
503 task->t.regs.ecx = (u32) *mode; in uvesafb_vbe_getmodes()
504 task->t.flags = TF_BUF_RET | TF_BUF_ESDI; in uvesafb_vbe_getmodes()
505 task->t.buf_len = sizeof(struct vbe_mode_ib); in uvesafb_vbe_getmodes()
506 task->buf = par->vbe_modes + off; in uvesafb_vbe_getmodes()
508 err = uvesafb_exec(task); in uvesafb_vbe_getmodes()
509 if (err || (task->t.regs.eax & 0xffff) != 0x004f) { in uvesafb_vbe_getmodes()
511 *mode, (u32)task->t.regs.eax, err); in uvesafb_vbe_getmodes()
517 mib = task->buf; in uvesafb_vbe_getmodes()
554 static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task, in uvesafb_vbe_getpmi() argument
559 uvesafb_reset(task); in uvesafb_vbe_getpmi()
560 task->t.regs.eax = 0x4f0a; in uvesafb_vbe_getpmi()
561 task->t.regs.ebx = 0x0; in uvesafb_vbe_getpmi()
562 err = uvesafb_exec(task); in uvesafb_vbe_getpmi()
566 if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) { in uvesafb_vbe_getpmi()
569 par->pmi_base = (u16 *)phys_to_virt(((u32)task->t.regs.es << 4) in uvesafb_vbe_getpmi()
570 + task->t.regs.edi); in uvesafb_vbe_getpmi()
574 (u16)task->t.regs.es, (u16)task->t.regs.edi); in uvesafb_vbe_getpmi()
615 static int uvesafb_vbe_getedid(struct uvesafb_ktask *task, struct fb_info *info) in uvesafb_vbe_getedid() argument
623 task->t.regs.eax = 0x4f15; in uvesafb_vbe_getedid()
624 task->t.regs.ebx = 0; in uvesafb_vbe_getedid()
625 task->t.regs.ecx = 0; in uvesafb_vbe_getedid()
626 task->t.buf_len = 0; in uvesafb_vbe_getedid()
627 task->t.flags = 0; in uvesafb_vbe_getedid()
629 err = uvesafb_exec(task); in uvesafb_vbe_getedid()
631 if ((task->t.regs.eax & 0xffff) != 0x004f || err) in uvesafb_vbe_getedid()
634 if ((task->t.regs.ebx & 0x3) == 3) { in uvesafb_vbe_getedid()
636 } else if ((task->t.regs.ebx & 0x3) == 2) { in uvesafb_vbe_getedid()
638 } else if ((task->t.regs.ebx & 0x3) == 1) { in uvesafb_vbe_getedid()
645 task->t.regs.eax = 0x4f15; in uvesafb_vbe_getedid()
646 task->t.regs.ebx = 1; in uvesafb_vbe_getedid()
647 task->t.regs.ecx = task->t.regs.edx = 0; in uvesafb_vbe_getedid()
648 task->t.flags = TF_BUF_RET | TF_BUF_ESDI; in uvesafb_vbe_getedid()
649 task->t.buf_len = EDID_LENGTH; in uvesafb_vbe_getedid()
650 task->buf = kzalloc(EDID_LENGTH, GFP_KERNEL); in uvesafb_vbe_getedid()
651 if (!task->buf) in uvesafb_vbe_getedid()
654 err = uvesafb_exec(task); in uvesafb_vbe_getedid()
656 if ((task->t.regs.eax & 0xffff) == 0x004f && !err) { in uvesafb_vbe_getedid()
657 fb_edid_to_monspecs(task->buf, &info->monspecs); in uvesafb_vbe_getedid()
672 kfree(task->buf); in uvesafb_vbe_getedid()
676 static void uvesafb_vbe_getmonspecs(struct uvesafb_ktask *task, in uvesafb_vbe_getmonspecs() argument
689 if (uvesafb_vbe_getedid(task, info)) { in uvesafb_vbe_getmonspecs()
755 static void uvesafb_vbe_getstatesize(struct uvesafb_ktask *task, in uvesafb_vbe_getstatesize() argument
760 uvesafb_reset(task); in uvesafb_vbe_getstatesize()
766 task->t.regs.eax = 0x4f04; in uvesafb_vbe_getstatesize()
767 task->t.regs.ecx = 0x000f; in uvesafb_vbe_getstatesize()
768 task->t.regs.edx = 0x0000; in uvesafb_vbe_getstatesize()
769 task->t.flags = 0; in uvesafb_vbe_getstatesize()
771 err = uvesafb_exec(task); in uvesafb_vbe_getstatesize()
773 if (err || (task->t.regs.eax & 0xffff) != 0x004f) { in uvesafb_vbe_getstatesize()
775 task->t.regs.eax, err); in uvesafb_vbe_getstatesize()
780 par->vbe_state_size = 64 * (task->t.regs.ebx & 0xffff); in uvesafb_vbe_getstatesize()
785 struct uvesafb_ktask *task = NULL; in uvesafb_vbe_init() local
789 task = uvesafb_prep(); in uvesafb_vbe_init()
790 if (!task) in uvesafb_vbe_init()
793 err = uvesafb_vbe_getinfo(task, par); in uvesafb_vbe_init()
797 err = uvesafb_vbe_getmodes(task, par); in uvesafb_vbe_init()
811 uvesafb_vbe_getpmi(task, par); in uvesafb_vbe_init()
820 uvesafb_vbe_getmonspecs(task, info); in uvesafb_vbe_init()
821 uvesafb_vbe_getstatesize(task, par); in uvesafb_vbe_init()
823 out: uvesafb_free(task); in uvesafb_vbe_init()
927 struct uvesafb_ktask *task; in uvesafb_setpalette() local
968 task = uvesafb_prep(); in uvesafb_setpalette()
969 if (!task) in uvesafb_setpalette()
972 task->t.regs.eax = 0x4f09; in uvesafb_setpalette()
973 task->t.regs.ebx = 0x0; in uvesafb_setpalette()
974 task->t.regs.ecx = count; in uvesafb_setpalette()
975 task->t.regs.edx = start; in uvesafb_setpalette()
976 task->t.flags = TF_BUF_ESDI; in uvesafb_setpalette()
977 task->t.buf_len = sizeof(struct uvesafb_pal_entry) * count; in uvesafb_setpalette()
978 task->buf = entries; in uvesafb_setpalette()
980 err = uvesafb_exec(task); in uvesafb_setpalette()
981 if ((task->t.regs.eax & 0xffff) != 0x004f) in uvesafb_setpalette()
984 uvesafb_free(task); in uvesafb_setpalette()
1108 struct uvesafb_ktask *task; in uvesafb_blank() local
1138 task = uvesafb_prep(); in uvesafb_blank()
1139 if (!task) in uvesafb_blank()
1142 task->t.regs.eax = 0x4f10; in uvesafb_blank()
1145 task->t.regs.ebx = 0x0001; in uvesafb_blank()
1148 task->t.regs.ebx = 0x0101; /* standby */ in uvesafb_blank()
1151 task->t.regs.ebx = 0x0401; /* powerdown */ in uvesafb_blank()
1157 err = uvesafb_exec(task); in uvesafb_blank()
1158 if (err || (task->t.regs.eax & 0xffff) != 0x004f) in uvesafb_blank()
1160 out: uvesafb_free(task); in uvesafb_blank()
1187 struct uvesafb_ktask *task = NULL; in uvesafb_release() local
1197 task = uvesafb_prep(); in uvesafb_release()
1198 if (!task) in uvesafb_release()
1202 task->t.regs.eax = 0x0003; in uvesafb_release()
1203 uvesafb_exec(task); in uvesafb_release()
1212 uvesafb_free(task); in uvesafb_release()
1219 struct uvesafb_ktask *task = NULL; in uvesafb_set_par() local
1235 task = uvesafb_prep(); in uvesafb_set_par()
1236 if (!task) in uvesafb_set_par()
1239 task->t.regs.eax = 0x4f02; in uvesafb_set_par()
1240 task->t.regs.ebx = mode->mode_id | 0x4000; /* use LFB */ in uvesafb_set_par()
1244 task->t.regs.ebx |= 0x0800; /* use CRTC data */ in uvesafb_set_par()
1245 task->t.flags = TF_BUF_ESDI; in uvesafb_set_par()
1276 task->t.buf_len = sizeof(struct vbe_crtc_ib); in uvesafb_set_par()
1277 task->buf = &par->crtc; in uvesafb_set_par()
1279 err = uvesafb_exec(task); in uvesafb_set_par()
1280 if (err || (task->t.regs.eax & 0xffff) != 0x004f) { in uvesafb_set_par()
1287 task->t.regs.eax, err); in uvesafb_set_par()
1288 uvesafb_reset(task); in uvesafb_set_par()
1295 task->t.regs.eax, err); in uvesafb_set_par()
1305 uvesafb_reset(task); in uvesafb_set_par()
1306 task->t.regs.eax = 0x4f08; in uvesafb_set_par()
1307 task->t.regs.ebx = 0x0800; in uvesafb_set_par()
1309 err = uvesafb_exec(task); in uvesafb_set_par()
1310 if (err || (task->t.regs.eax & 0xffff) != 0x004f || in uvesafb_set_par()
1311 ((task->t.regs.ebx & 0xff00) >> 8) != 8) { in uvesafb_set_par()
1324 uvesafb_free(task); in uvesafb_set_par()
1926 struct uvesafb_ktask *task; in uvesafb_exit() local
1929 task = uvesafb_prep(); in uvesafb_exit()
1930 if (task) { in uvesafb_exit()
1931 task->t.flags = TF_EXIT; in uvesafb_exit()
1932 uvesafb_exec(task); in uvesafb_exit()
1933 uvesafb_free(task); in uvesafb_exit()