Lines Matching +full:top +full:- +full:left
1 // SPDX-License-Identifier: GPL-2.0-or-later
4 btcx-risc.c
8 (c) 2000-03 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]
23 #include "btcx-risc.h"
36 /* ---------------------------------------------------------- */
44 if (NULL == risc->cpu) in btcx_riscmem_free()
47 memcnt--; in btcx_riscmem_free()
49 memcnt, (unsigned long)risc->dma); in btcx_riscmem_free()
51 pci_free_consistent(pci, risc->size, risc->cpu, risc->dma); in btcx_riscmem_free()
62 if (NULL != risc->cpu && risc->size < size) in btcx_riscmem_alloc()
64 if (NULL == risc->cpu) { in btcx_riscmem_alloc()
67 return -ENOMEM; in btcx_riscmem_alloc()
68 risc->cpu = cpu; in btcx_riscmem_alloc()
69 risc->dma = dma; in btcx_riscmem_alloc()
70 risc->size = size; in btcx_riscmem_alloc()
76 memset(risc->cpu,0,risc->size); in btcx_riscmem_alloc()
80 /* ---------------------------------------------------------- */
87 if (win->left < 0) { in btcx_screen_clips()
88 /* left */ in btcx_screen_clips()
89 clips[n].c.left = 0; in btcx_screen_clips()
90 clips[n].c.top = 0; in btcx_screen_clips()
91 clips[n].c.width = -win->left; in btcx_screen_clips()
92 clips[n].c.height = win->height; in btcx_screen_clips()
95 if (win->left + win->width > swidth) { in btcx_screen_clips()
97 clips[n].c.left = swidth - win->left; in btcx_screen_clips()
98 clips[n].c.top = 0; in btcx_screen_clips()
99 clips[n].c.width = win->width - clips[n].c.left; in btcx_screen_clips()
100 clips[n].c.height = win->height; in btcx_screen_clips()
103 if (win->top < 0) { in btcx_screen_clips()
104 /* top */ in btcx_screen_clips()
105 clips[n].c.left = 0; in btcx_screen_clips()
106 clips[n].c.top = 0; in btcx_screen_clips()
107 clips[n].c.width = win->width; in btcx_screen_clips()
108 clips[n].c.height = -win->top; in btcx_screen_clips()
111 if (win->top + win->height > sheight) { in btcx_screen_clips()
113 clips[n].c.left = 0; in btcx_screen_clips()
114 clips[n].c.top = sheight - win->top; in btcx_screen_clips()
115 clips[n].c.width = win->width; in btcx_screen_clips()
116 clips[n].c.height = win->height - clips[n].c.top; in btcx_screen_clips()
129 nx = (win->left + mask) & ~mask; in btcx_align()
130 nw = (win->width) & ~mask; in btcx_align()
131 if (nx + nw > win->left + win->width) in btcx_align()
132 nw -= mask+1; in btcx_align()
133 dx = nx - win->left; in btcx_align()
134 win->left = nx; in btcx_align()
135 win->width = nw; in btcx_align()
137 win->width, win->height, win->left, win->top, dx); in btcx_align()
141 nx = (clips[i].c.left-dx) & ~mask; in btcx_align()
143 if (nx + nw < clips[i].c.left-dx + clips[i].c.width) in btcx_align()
145 clips[i].c.left = nx; in btcx_align()
149 clips[i].c.left, clips[i].c.top); in btcx_align()
161 for (i = nclips-2; i >= 0; i--) { in btcx_sort_clips()
163 if (clips[j].c.left > clips[j+1].c.left) { in btcx_sort_clips()
186 if (clips[clip].c.left + clips[clip].c.width <= 0) in btcx_calc_skips()
188 if (clips[clip].c.left > (signed)width) in btcx_calc_skips()
192 if (line > clips[clip].c.top+clips[clip].c.height-1) in btcx_calc_skips()
194 if (line < clips[clip].c.top) { in btcx_calc_skips()
195 if (maxline > clips[clip].c.top-1) in btcx_calc_skips()
196 maxline = clips[clip].c.top-1; in btcx_calc_skips()
199 if (maxline > clips[clip].c.top+clips[clip].c.height-1) in btcx_calc_skips()
200 maxline = clips[clip].c.top+clips[clip].c.height-1; in btcx_calc_skips()
203 if (0 == skip || clips[clip].c.left > skips[skip-1].end) { in btcx_calc_skips()
205 skips[skip].start = clips[clip].c.left; in btcx_calc_skips()
208 skips[skip].end = clips[clip].c.left + clips[clip].c.width; in btcx_calc_skips()
213 /* overlaps -- expand last one */ in btcx_calc_skips()
214 end = clips[clip].c.left + clips[clip].c.width; in btcx_calc_skips()
215 if (skips[skip-1].end < end) in btcx_calc_skips()
216 skips[skip-1].end = end; in btcx_calc_skips()
217 if (skips[skip-1].end > width) in btcx_calc_skips()
218 skips[skip-1].end = width; in btcx_calc_skips()
225 dprintk("btcx: skips line %d-%d:", line, maxline); in btcx_calc_skips()
227 pr_cont(" %d-%d", skips[skip].start, skips[skip].end); in btcx_calc_skips()