summaryrefslogtreecommitdiff
path: root/linux-core/drm_context.c
AgeCommit message (Expand)Author
2005-06-04misc cleanup patch from Adrian BunkDave Airlie
2004-10-18Update Doxygen configuration & comments.Jose Fonseca
2004-10-12Breakout heads into their own data structures.Jon Smirl
2004-10-10Rename fn_tbl to driver. Core driver now uses pci_driver name whichJon Smirl
2004-09-30Lindent of core build. Drivers checked for no binary diffs. A few filesJon Smirl
2004-09-27First check in for DRM that splits core from personality modulesJon Smirl
2004-09-05merge back bunch of whitespace and misc changes from kernelDave Airlie
2004-09-02oops called ctor instead of dtor.. found this on the kernel mergeDave Airlie
2004-08-29remove hacky context thing that was gamma onlyDave Airlie
2004-08-27__NO_VERSION__ hasn't been needed since 2.3 days ditch it...Dave Airlie
2004-08-24Merged drmfntbl-0-0-2Dave Airlie
2004-08-17Merged drmfntbl-0-0-1Dave Airlie
2004-08-14Add a "dev" argument to DRIVER_CTX_[CD]TOR. This will be used in anEric Anholt
2004-07-20first set of __user annotations from kernel (Al Viro)Dave Airlie
2004-02-20drm_ctx_dtor.patch Submitted by: Erdi ChenKeith Whitwell
2003-05-27Merged DRM documentation.Jose Fonseca
2003-04-22remove unused variableAlan Hourihane
2003-04-22Move a chunk of gamma-specific code out of drm_dma.h. Remove unusedKeith Whitwell
2003-04-22remove unused dma histogram codeKeith Whitwell
2003-04-22Move a bunch of gamma-specific code into a gamma-specific file. Restore theKeith Whitwell
2003-04-22remove DRM read, poll and write_stringKeith Whitwell
2003-04-08Use list_entry() to get container struct from struct list_head pointers.Leif Delgass
2002-06-25gamma_alloc -> DRM(alloc)Alan Hourihane
2002-01-27First pass merge of XFree86 4.2.0 import.David Dawes
2001-09-25merge with 2.4.10 kernelAlan Hourihane
2001-08-13Sync with Linus 2.4.9-pre2 + make all nopage routines more alikeJeff Hartmann
2001-08-07Lots of DRM fixes: added new pieces of template code so the ffb driver canJeff Hartmann
2001-03-14Merged sarea-1-0-0Kevin E Martin
2001-02-16- Clean up the way customization of the templates is done.Gareth Hughes
2001-02-15Merge mga-1-0-0-branch into trunk.Gareth Hughes
num">2) { YUV yuv1 = read_rgb_as_yuv(src_fb, x + 0, y); YUV yuv2 = read_rgb_as_yuv(src_fb, x + 1, y); switch (dst_fb.format()) { case PixelFormat::UYVY: dst[x * 2 + 0] = (yuv1.u + yuv2.u) / 2; dst[x * 2 + 1] = yuv1.y; dst[x * 2 + 2] = (yuv1.v + yuv2.v) / 2; dst[x * 2 + 3] = yuv2.y; break; case PixelFormat::YUYV: dst[x * 2 + 0] = yuv1.y; dst[x * 2 + 1] = (yuv1.u + yuv2.u) / 2; dst[x * 2 + 2] = yuv2.y; dst[x * 2 + 3] = (yuv1.v + yuv2.v) / 2; break; default: throw std::invalid_argument("fo"); } } dst += dst_fb.stride(0); } } static void fb_rgb_to_semiplanar_yuv(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb) { unsigned w = src_fb.width(); unsigned h = src_fb.height(); uint8_t *dst_y = dst_fb.map(0); uint8_t *dst_uv = dst_fb.map(1); for (unsigned y = 0; y < h; ++y) { for (unsigned x = 0; x < w; ++x) { YUV yuv = read_rgb_as_yuv(src_fb, x, y); dst_y[x] = yuv.y; } dst_y += dst_fb.stride(0); } for (unsigned y = 0; y < h; y += 2) { for (unsigned x = 0; x < w; x += 2) { YUV yuv00 = read_rgb_as_yuv(src_fb, x + 0, y + 0); YUV yuv01 = read_rgb_as_yuv(src_fb, x + 1, y + 0); YUV yuv10 = read_rgb_as_yuv(src_fb, x + 0, y + 1); YUV yuv11 = read_rgb_as_yuv(src_fb, x + 1, y + 1); unsigned u = (yuv00.u + yuv01.u + yuv10.u + yuv11.u) / 4; unsigned v = (yuv00.v + yuv01.v + yuv10.v + yuv11.v) / 4; dst_uv[x + 0] = u; dst_uv[x + 1] = v; } dst_uv += dst_fb.stride(1); } } static void fb_rgb_to_rgb565(DumbFramebuffer& dst_fb, const DumbFramebuffer& src_fb) { unsigned w = src_fb.width(); unsigned h = src_fb.height(); uint8_t *dst = dst_fb.map(0); for (unsigned y = 0; y < h; ++y) { for (unsigned x = 0; x < w; ++x) { RGB rgb = read_rgb(src_fb, x, y); unsigned r = rgb.r * 32 / 256; unsigned g = rgb.g * 64 / 256; unsigned b = rgb.b * 32 / 256; ((uint16_t *)dst)[x] = (r << 11) | (g << 5) | (b << 0); } dst += dst_fb.stride(0); } } void color_convert(DumbFramebuffer& dst, const DumbFramebuffer &src) { switch (dst.format()) { case PixelFormat::NV12: case PixelFormat::NV21: fb_rgb_to_semiplanar_yuv(dst, src); break; case PixelFormat::YUYV: case PixelFormat::UYVY: fb_rgb_to_packed_yuv(dst, src); break; case PixelFormat::RGB565: fb_rgb_to_rgb565(dst, src); break; default: throw std::invalid_argument("fo"); } } }