ps3_syscons.c (9b4fcf851a73554063d4a2de9a4f10cd23a0a4f6) ps3_syscons.c (263b790117fe175573ade8ed170a32d3a0c005f4)
1/*-
2 * Copyright (c) 2003 Peter Grehan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

116 int sc_ncol;
117 int sc_nrow;
118
119 int sc_xmargin;
120 int sc_ymargin;
121
122 u_char *sc_font;
123 int sc_font_height;
1/*-
2 * Copyright (c) 2003 Peter Grehan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

116 int sc_ncol;
117 int sc_nrow;
118
119 int sc_xmargin;
120 int sc_ymargin;
121
122 u_char *sc_font;
123 int sc_font_height;
124
125 uint64_t sc_fbhandle;
126 uint64_t sc_fbcontext;
127 uint64_t sc_dma_control;
128 uint64_t sc_driver_info;
129 uint64_t sc_reports;
130 uint64_t sc_reports_size;
124};
125
126static video_switch_t ps3fbvidsw = {
127 .probe = ps3fb_probe,
128 .init = ps3fb_init,
129 .get_info = ps3fb_get_info,
130 .query_mode = ps3fb_query_mode,
131 .set_mode = ps3fb_set_mode,

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

271 ps3fb_init(0, &sc->sc_va, 0);
272
273 return (0);
274}
275
276void
277ps3fb_remap(void)
278{
131};
132
133static video_switch_t ps3fbvidsw = {
134 .probe = ps3fb_probe,
135 .init = ps3fb_init,
136 .get_info = ps3fb_get_info,
137 .query_mode = ps3fb_query_mode,
138 .set_mode = ps3fb_set_mode,

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

278 ps3fb_init(0, &sc->sc_va, 0);
279
280 return (0);
281}
282
283void
284ps3fb_remap(void)
285{
286 struct ps3fb_softc *sc;
279 vm_offset_t va, fb_paddr;
287 vm_offset_t va, fb_paddr;
280 uint64_t fbhandle, fbcontext;
281
288
289 sc = &ps3fb_softc;
290
282 lv1_gpu_close();
283 lv1_gpu_open(0);
284
285 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET,
286 0,0,0,0);
287 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET,
288 0,0,1,0);
289 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
290 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
291 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
292 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
291 lv1_gpu_close();
292 lv1_gpu_open(0);
293
294 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET,
295 0,0,0,0);
296 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_MODE_SET,
297 0,0,1,0);
298 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
299 0,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
300 lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
301 1,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
293 lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &fbhandle, &fb_paddr);
294 lv1_gpu_context_allocate(fbhandle, 0, &fbcontext);
302 lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &sc->sc_fbhandle, &fb_paddr);
303 lv1_gpu_context_allocate(sc->sc_fbhandle, 0, &sc->sc_fbcontext, &sc->sc_dma_control,
304 &sc->sc_driver_info, &sc->sc_reports, &sc->sc_reports_size);
295
305
296 lv1_gpu_context_attribute(fbcontext,
306 lv1_gpu_context_attribute(sc->sc_fbcontext,
297 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0);
307 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0);
298 lv1_gpu_context_attribute(fbcontext,
308 lv1_gpu_context_attribute(sc->sc_fbcontext,
299 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);
300
301 for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE)
302 pmap_kenter_attr(0x10000000 + va, fb_paddr + va,
303 VM_MEMATTR_WRITE_COMBINING);
304}
305
306static int

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

400 struct ps3fb_softc *sc;
401
402 sc = (struct ps3fb_softc *)adp;
403
404 /* XXX: no real mode setting at the moment */
405
406 ps3fb_blank_display(&sc->sc_va, V_DISPLAY_ON);
407
309 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);
310
311 for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE)
312 pmap_kenter_attr(0x10000000 + va, fb_paddr + va,
313 VM_MEMATTR_WRITE_COMBINING);
314}
315
316static int

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

410 struct ps3fb_softc *sc;
411
412 sc = (struct ps3fb_softc *)adp;
413
414 /* XXX: no real mode setting at the moment */
415
416 ps3fb_blank_display(&sc->sc_va, V_DISPLAY_ON);
417
418 lv1_gpu_context_attribute(sc->sc_fbcontext,
419 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0);
420 lv1_gpu_context_attribute(sc->sc_fbcontext,
421 L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);
422
408 return (0);
409}
410
411static int
412ps3fb_save_font(video_adapter_t *adp, int page, int size, int width,
413 u_char *data, int c, int count)
414{
415 TODO;

--- 342 unchanged lines hidden ---
423 return (0);
424}
425
426static int
427ps3fb_save_font(video_adapter_t *adp, int page, int size, int width,
428 u_char *data, int c, int count)
429{
430 TODO;

--- 342 unchanged lines hidden ---