Support infrastructure for X11 on PS3.
Submitted by: geoffrey dot levand at mail dot ru MFC after: 1 week
This commit is contained in:
parent
795c0232aa
commit
263b790117
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=228689
@ -1081,13 +1081,25 @@ ASENTRY(lv1_gpu_memory_free)
|
||||
ASENTRY(lv1_gpu_context_allocate)
|
||||
mflr %r0
|
||||
std %r0,16(%r1)
|
||||
stdu %r1,-56(%r1)
|
||||
stdu %r1,-88(%r1)
|
||||
std %r5,48(%r1)
|
||||
std %r6,56(%r1)
|
||||
std %r7,64(%r1)
|
||||
std %r8,72(%r1)
|
||||
std %r9,80(%r1)
|
||||
li %r11,217
|
||||
hc
|
||||
extsw %r3,%r3
|
||||
ld %r11,48(%r1)
|
||||
std %r4,0(%r11)
|
||||
ld %r11,56(%r1)
|
||||
std %r5,0(%r11)
|
||||
ld %r11,64(%r1)
|
||||
std %r6,0(%r11)
|
||||
ld %r11,72(%r1)
|
||||
std %r7,0(%r11)
|
||||
ld %r11,80(%r1)
|
||||
std %r8,0(%r11)
|
||||
ld %r1,0(%r1)
|
||||
ld %r0,16(%r1)
|
||||
mtlr %r0
|
||||
@ -1144,6 +1156,18 @@ ASENTRY(lv1_gpu_context_intr)
|
||||
mtlr %r0
|
||||
blr
|
||||
|
||||
ASENTRY(lv1_gpu_attribute)
|
||||
mflr %r0
|
||||
std %r0,16(%r1)
|
||||
stdu %r1,-48(%r1)
|
||||
li %r11,228
|
||||
hc
|
||||
extsw %r3,%r3
|
||||
ld %r1,0(%r1)
|
||||
ld %r0,16(%r1)
|
||||
mtlr %r0
|
||||
blr
|
||||
|
||||
ASENTRY(lv1_get_rtc)
|
||||
mflr %r0
|
||||
std %r0,16(%r1)
|
||||
|
@ -124,11 +124,12 @@ int lv1_gpu_device_map(uint64_t dev, uint64_t *lpar_addr, uint64_t *lpar_size);
|
||||
int lv1_gpu_device_unmap(uint64_t dev);
|
||||
int lv1_gpu_memory_allocate(uint64_t ddr_size, uint64_t zero1, uint64_t zero2, uint64_t zero3, uint64_t zero4, uint64_t *handle, uint64_t *ddr_lpar);
|
||||
int lv1_gpu_memory_free(uint64_t handle);
|
||||
int lv1_gpu_context_allocate(uint64_t handle, uint64_t , uint64_t *zero);
|
||||
int lv1_gpu_context_allocate(uint64_t handle, uint64_t flags, uint64_t *chandle, uint64_t *lpar_dma_control, uint64_t *lpar_driver_info, uint64_t *lpar_reports, uint64_t *lpar_reports_size);
|
||||
int lv1_gpu_context_free(uint64_t chandle);
|
||||
int lv1_gpu_context_iomap(uint64_t changle, uint64_t gpu_ioif, uint64_t xdr_lpar, uint64_t fbsize, uint64_t ioflags);
|
||||
int lv1_gpu_context_attribute(uint64_t chandle, uint64_t op, uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4);
|
||||
int lv1_gpu_context_intr(uint64_t chandle, uint64_t *v1);
|
||||
int lv1_gpu_attribute(uint64_t p1, uint64_t p2, uint64_t p3, uint64_t p4, uint64_t p5);
|
||||
int lv1_get_rtc(uint64_t *rtc_val, uint64_t *timebase);
|
||||
int lv1_storage_read(uint64_t dev, uint64_t region, uint64_t sector, uint64_t nsectors, uint64_t flags, uint64_t buf, uint64_t *dma_tag);
|
||||
int lv1_storage_write(uint64_t dev, uint64_t region, uint64_t sector, uint64_t nsectors, uint64_t flags, uint64_t buf, uint64_t *dma_tag);
|
||||
|
@ -125,11 +125,12 @@ HVCALL 212 lv1_gpu_device_map dev lpar_addr,lpar_size
|
||||
HVCALL 213 lv1_gpu_device_unmap dev
|
||||
HVCALL 214 lv1_gpu_memory_allocate ddr_size,zero1,zero2,zero3,zero4 handle,ddr_lpar
|
||||
HVCALL 216 lv1_gpu_memory_free handle
|
||||
HVCALL 217 lv1_gpu_context_allocate handle, zero chandle,lpar_dma_control,lpar_driver_info,lpar_reports,lpar_reports_size
|
||||
HVCALL 217 lv1_gpu_context_allocate handle,flags chandle,lpar_dma_control,lpar_driver_info,lpar_reports,lpar_reports_size
|
||||
HVCALL 218 lv1_gpu_context_free chandle
|
||||
HVCALL 221 lv1_gpu_context_iomap changle,gpu_ioif,xdr_lpar,fbsize,ioflags
|
||||
HVCALL 225 lv1_gpu_context_attribute chandle,op,p1,p2,p3,p4
|
||||
HVCALL 227 lv1_gpu_context_intr chandle v1
|
||||
HVCALL 228 lv1_gpu_attribute p1,p2,p3,p4,p5
|
||||
HVCALL 232 lv1_get_rtc UNUSED rtc_val,timebase
|
||||
HVCALL 245 lv1_storage_read dev,region,sector,nsectors,flags,buf dma_tag
|
||||
HVCALL 246 lv1_storage_write dev,region,sector,nsectors,flags,buf dma_tag
|
||||
|
@ -121,6 +121,13 @@ struct ps3fb_softc {
|
||||
|
||||
u_char *sc_font;
|
||||
int sc_font_height;
|
||||
|
||||
uint64_t sc_fbhandle;
|
||||
uint64_t sc_fbcontext;
|
||||
uint64_t sc_dma_control;
|
||||
uint64_t sc_driver_info;
|
||||
uint64_t sc_reports;
|
||||
uint64_t sc_reports_size;
|
||||
};
|
||||
|
||||
static video_switch_t ps3fbvidsw = {
|
||||
@ -276,8 +283,10 @@ ps3fb_configure(int flags)
|
||||
void
|
||||
ps3fb_remap(void)
|
||||
{
|
||||
struct ps3fb_softc *sc;
|
||||
vm_offset_t va, fb_paddr;
|
||||
uint64_t fbhandle, fbcontext;
|
||||
|
||||
sc = &ps3fb_softc;
|
||||
|
||||
lv1_gpu_close();
|
||||
lv1_gpu_open(0);
|
||||
@ -290,12 +299,13 @@ ps3fb_remap(void)
|
||||
0,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
|
||||
lv1_gpu_context_attribute(0, L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_SYNC,
|
||||
1,L1GPU_DISPLAY_SYNC_VSYNC,0,0);
|
||||
lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &fbhandle, &fb_paddr);
|
||||
lv1_gpu_context_allocate(fbhandle, 0, &fbcontext);
|
||||
lv1_gpu_memory_allocate(PS3FB_SIZE, 0, 0, 0, 0, &sc->sc_fbhandle, &fb_paddr);
|
||||
lv1_gpu_context_allocate(sc->sc_fbhandle, 0, &sc->sc_fbcontext, &sc->sc_dma_control,
|
||||
&sc->sc_driver_info, &sc->sc_reports, &sc->sc_reports_size);
|
||||
|
||||
lv1_gpu_context_attribute(fbcontext,
|
||||
lv1_gpu_context_attribute(sc->sc_fbcontext,
|
||||
L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0);
|
||||
lv1_gpu_context_attribute(fbcontext,
|
||||
lv1_gpu_context_attribute(sc->sc_fbcontext,
|
||||
L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);
|
||||
|
||||
for (va = 0; va < PS3FB_SIZE; va += PAGE_SIZE)
|
||||
@ -405,6 +415,11 @@ ps3fb_set_mode(video_adapter_t *adp, int mode)
|
||||
|
||||
ps3fb_blank_display(&sc->sc_va, V_DISPLAY_ON);
|
||||
|
||||
lv1_gpu_context_attribute(sc->sc_fbcontext,
|
||||
L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0);
|
||||
lv1_gpu_context_attribute(sc->sc_fbcontext,
|
||||
L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user