drivers/gpu/drm/i915/gvt/fb_decoder.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gvt/fb_decoder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gvt/fb_decoder.c- Extension
.c- Size
- 11709 bytes
- Lines
- 403
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/drm/drm_fourcc.hdisplay/i9xx_plane_regs.hdisplay/intel_cursor_regs.hdisplay/intel_display_regs.hdisplay/intel_sprite_regs.hdisplay/skl_universal_plane_regs.hdisplay_helpers.hgvt.hi915_drv.hi915_pvinfo.hi915_reg.h
Detected Declarations
struct pixel_formatstruct cursor_mode_formatfunction bdw_format_to_drmfunction skl_format_to_drmfunction intel_vgpu_get_stridefunction get_active_pipefunction intel_vgpu_decode_primary_planefunction cursor_mode_to_drmfunction intel_vgpu_decode_cursor_plane
Annotated Snippet
struct pixel_format {
int drm_format; /* Pixel format in DRM definition */
int bpp; /* Bits per pixel, 0 indicates invalid */
const char *desc; /* The description */
};
static const struct pixel_format bdw_pixel_formats[] = {
{DRM_FORMAT_C8, 8, "8-bit Indexed"},
{DRM_FORMAT_RGB565, 16, "16-bit BGRX (5:6:5 MSB-R:G:B)"},
{DRM_FORMAT_XRGB8888, 32, "32-bit BGRX (8:8:8:8 MSB-X:R:G:B)"},
{DRM_FORMAT_XBGR2101010, 32, "32-bit RGBX (2:10:10:10 MSB-X:B:G:R)"},
{DRM_FORMAT_XRGB2101010, 32, "32-bit BGRX (2:10:10:10 MSB-X:R:G:B)"},
{DRM_FORMAT_XBGR8888, 32, "32-bit RGBX (8:8:8:8 MSB-X:B:G:R)"},
/* non-supported format has bpp default to 0 */
{}
};
static const struct pixel_format skl_pixel_formats[] = {
{DRM_FORMAT_YUYV, 16, "16-bit packed YUYV (8:8:8:8 MSB-V:Y2:U:Y1)"},
{DRM_FORMAT_UYVY, 16, "16-bit packed UYVY (8:8:8:8 MSB-Y2:V:Y1:U)"},
{DRM_FORMAT_YVYU, 16, "16-bit packed YVYU (8:8:8:8 MSB-U:Y2:V:Y1)"},
{DRM_FORMAT_VYUY, 16, "16-bit packed VYUY (8:8:8:8 MSB-Y2:U:Y1:V)"},
{DRM_FORMAT_C8, 8, "8-bit Indexed"},
{DRM_FORMAT_RGB565, 16, "16-bit BGRX (5:6:5 MSB-R:G:B)"},
{DRM_FORMAT_ABGR8888, 32, "32-bit RGBA (8:8:8:8 MSB-A:B:G:R)"},
{DRM_FORMAT_XBGR8888, 32, "32-bit RGBX (8:8:8:8 MSB-X:B:G:R)"},
{DRM_FORMAT_ARGB8888, 32, "32-bit BGRA (8:8:8:8 MSB-A:R:G:B)"},
{DRM_FORMAT_XRGB8888, 32, "32-bit BGRX (8:8:8:8 MSB-X:R:G:B)"},
{DRM_FORMAT_XBGR2101010, 32, "32-bit RGBX (2:10:10:10 MSB-X:B:G:R)"},
{DRM_FORMAT_XRGB2101010, 32, "32-bit BGRX (2:10:10:10 MSB-X:R:G:B)"},
/* non-supported format has bpp default to 0 */
{}
};
static int bdw_format_to_drm(int format)
{
int bdw_pixel_formats_index = 6;
switch (format) {
case DISP_FORMAT_8BPP:
bdw_pixel_formats_index = 0;
break;
case DISP_FORMAT_BGRX565:
bdw_pixel_formats_index = 1;
break;
case DISP_FORMAT_BGRX888:
bdw_pixel_formats_index = 2;
break;
case DISP_FORMAT_RGBX101010:
bdw_pixel_formats_index = 3;
break;
case DISP_FORMAT_BGRX101010:
bdw_pixel_formats_index = 4;
break;
case DISP_FORMAT_RGBX888:
bdw_pixel_formats_index = 5;
break;
default:
break;
}
return bdw_pixel_formats_index;
}
static int skl_format_to_drm(int format, bool rgb_order, bool alpha,
int yuv_order)
{
int skl_pixel_formats_index = 12;
switch (format) {
case PLANE_CTL_FORMAT_INDEXED:
skl_pixel_formats_index = 4;
break;
case PLANE_CTL_FORMAT_RGB_565:
skl_pixel_formats_index = 5;
break;
case PLANE_CTL_FORMAT_XRGB_8888:
if (rgb_order)
skl_pixel_formats_index = alpha ? 6 : 7;
else
skl_pixel_formats_index = alpha ? 8 : 9;
break;
case PLANE_CTL_FORMAT_XRGB_2101010:
skl_pixel_formats_index = rgb_order ? 10 : 11;
Annotation
- Immediate include surface: `uapi/drm/drm_fourcc.h`, `display/i9xx_plane_regs.h`, `display/intel_cursor_regs.h`, `display/intel_display_regs.h`, `display/intel_sprite_regs.h`, `display/skl_universal_plane_regs.h`, `display_helpers.h`, `gvt.h`.
- Detected declarations: `struct pixel_format`, `struct cursor_mode_format`, `function bdw_format_to_drm`, `function skl_format_to_drm`, `function intel_vgpu_get_stride`, `function get_active_pipe`, `function intel_vgpu_decode_primary_plane`, `function cursor_mode_to_drm`, `function intel_vgpu_decode_cursor_plane`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.