Lines Matching defs:from
160 * @from: frame buffer colormap structure
163 * Copy contents of colormap from @from to @to.
166 int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to)
171 if (to->start > from->start)
172 fromoff = to->start - from->start;
174 tooff = from->start - to->start;
175 if (fromoff >= from->len || tooff >= to->len)
178 size = min_t(size_t, to->len - tooff, from->len - fromoff);
183 memcpy(to->red+tooff, from->red+fromoff, size);
184 memcpy(to->green+tooff, from->green+fromoff, size);
185 memcpy(to->blue+tooff, from->blue+fromoff, size);
186 if (from->transp && to->transp)
187 memcpy(to->transp+tooff, from->transp+fromoff, size);
191 int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to)
196 if (to->start > from->start)
197 fromoff = to->start - from->start;
199 tooff = from->start - to->start;
200 if (fromoff >= from->len || tooff >= to->len)
203 size = min_t(size_t, to->len - tooff, from->len - fromoff);
208 if (copy_to_user(to->red+tooff, from->red+fromoff, size))
210 if (copy_to_user(to->green+tooff, from->green+fromoff, size))
212 if (copy_to_user(to->blue+tooff, from->blue+fromoff, size))
214 if (from->transp && to->transp)
215 if (copy_to_user(to->transp+tooff, from->transp+fromoff, size))