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 dma_free_coherent(&pci->dev, 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()
65 cpu = dma_alloc_coherent(&pci->dev, size, &dma, GFP_KERNEL); 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()
79 /* ---------------------------------------------------------- */
86 if (win->left < 0) { in btcx_screen_clips()
87 /* left */ in btcx_screen_clips()
88 clips[n].c.left = 0; in btcx_screen_clips()
89 clips[n].c.top = 0; in btcx_screen_clips()
90 clips[n].c.width = -win->left; in btcx_screen_clips()
91 clips[n].c.height = win->height; in btcx_screen_clips()
94 if (win->left + win->width > swidth) { in btcx_screen_clips()
96 clips[n].c.left = swidth - win->left; in btcx_screen_clips()
97 clips[n].c.top = 0; in btcx_screen_clips()
98 clips[n].c.width = win->width - clips[n].c.left; in btcx_screen_clips()
99 clips[n].c.height = win->height; in btcx_screen_clips()
102 if (win->top < 0) { in btcx_screen_clips()
103 /* top */ in btcx_screen_clips()
104 clips[n].c.left = 0; in btcx_screen_clips()
105 clips[n].c.top = 0; in btcx_screen_clips()
106 clips[n].c.width = win->width; in btcx_screen_clips()
107 clips[n].c.height = -win->top; in btcx_screen_clips()
110 if (win->top + win->height > sheight) { in btcx_screen_clips()
112 clips[n].c.left = 0; in btcx_screen_clips()
113 clips[n].c.top = sheight - win->top; in btcx_screen_clips()
114 clips[n].c.width = win->width; in btcx_screen_clips()
115 clips[n].c.height = win->height - clips[n].c.top; in btcx_screen_clips()
128 nx = (win->left + mask) & ~mask; in btcx_align()
129 nw = (win->width) & ~mask; in btcx_align()
130 if (nx + nw > win->left + win->width) in btcx_align()
131 nw -= mask+1; in btcx_align()
132 dx = nx - win->left; in btcx_align()
133 win->left = nx; in btcx_align()
134 win->width = nw; in btcx_align()
136 win->width, win->height, win->left, win->top, dx); in btcx_align()
140 nx = (clips[i].c.left-dx) & ~mask; in btcx_align()
142 if (nx + nw < clips[i].c.left-dx + clips[i].c.width) in btcx_align()
144 clips[i].c.left = nx; in btcx_align()
148 clips[i].c.left, clips[i].c.top); in btcx_align()
160 for (i = nclips-2; i >= 0; i--) { in btcx_sort_clips()
162 if (clips[j].c.left > clips[j+1].c.left) { in btcx_sort_clips()
185 if (clips[clip].c.left + clips[clip].c.width <= 0) in btcx_calc_skips()
187 if (clips[clip].c.left > (signed)width) in btcx_calc_skips()
191 if (line > clips[clip].c.top+clips[clip].c.height-1) in btcx_calc_skips()
193 if (line < clips[clip].c.top) { in btcx_calc_skips()
194 if (maxline > clips[clip].c.top-1) in btcx_calc_skips()
195 maxline = clips[clip].c.top-1; in btcx_calc_skips()
198 if (maxline > clips[clip].c.top+clips[clip].c.height-1) in btcx_calc_skips()
199 maxline = clips[clip].c.top+clips[clip].c.height-1; in btcx_calc_skips()
202 if (0 == skip || clips[clip].c.left > skips[skip-1].end) { in btcx_calc_skips()
204 skips[skip].start = clips[clip].c.left; in btcx_calc_skips()
207 skips[skip].end = clips[clip].c.left + clips[clip].c.width; in btcx_calc_skips()
212 /* overlaps -- expand last one */ in btcx_calc_skips()
213 end = clips[clip].c.left + clips[clip].c.width; in btcx_calc_skips()
214 if (skips[skip-1].end < end) in btcx_calc_skips()
215 skips[skip-1].end = end; in btcx_calc_skips()
216 if (skips[skip-1].end > width) in btcx_calc_skips()
217 skips[skip-1].end = width; in btcx_calc_skips()
224 dprintk("btcx: skips line %d-%d:", line, maxline); in btcx_calc_skips()
226 pr_cont(" %d-%d", skips[skip].start, skips[skip].end); in btcx_calc_skips()