drivers/gpu/drm/mgag200/mgag200_g200eh5.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/mgag200/mgag200_g200eh5.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/mgag200/mgag200_g200eh5.c
Extension
.c
Size
5294 bytes
Lines
206
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.

Dependency Surface

Detected Declarations

Annotated Snippet

if (ftmp_delta < fdelta) {
					fdelta = ftmp_delta;
					uc_m = (u8)(0xFF & test_m);
					uc_n = (u8)((0x7 & (test_div_a - 1))
						| (0x70 & (0x7 & (test_div_b - 1)) << 4));
					uc_p = (u8)(1 & (test_m >> 8));
				}
				if (fdelta == 0)
					break;
			}
			if (fdelta == 0)
				break;
		}
		if (fdelta == 0)
			break;
	}

	pixpllc->m = uc_m + 1;
	pixpllc->n = uc_n + 1;
	pixpllc->p = uc_p + 1;
	pixpllc->s = 0;

	return 0;
	}

/*
 * Mode-setting pipeline
 */

static const struct drm_plane_helper_funcs mgag200_g200eh5_primary_plane_helper_funcs = {
	MGAG200_PRIMARY_PLANE_HELPER_FUNCS,
};

static const struct drm_plane_funcs mgag200_g200eh5_primary_plane_funcs = {
	MGAG200_PRIMARY_PLANE_FUNCS,
};

static const struct drm_crtc_helper_funcs mgag200_g200eh5_crtc_helper_funcs = {
	MGAG200_CRTC_HELPER_FUNCS,
};

static const struct drm_crtc_funcs mgag200_g200eh5_crtc_funcs = {
	MGAG200_CRTC_FUNCS,
};

static int mgag200_g200eh5_pipeline_init(struct mga_device *mdev)
{
	struct drm_device *dev = &mdev->base;
	struct drm_plane *primary_plane = &mdev->primary_plane;
	struct drm_crtc *crtc = &mdev->crtc;
	int ret;

	ret = drm_universal_plane_init(dev, primary_plane, 0,
				       &mgag200_g200eh5_primary_plane_funcs,
				       mgag200_primary_plane_formats,
				       mgag200_primary_plane_formats_size,
				       mgag200_primary_plane_fmtmods,
				       DRM_PLANE_TYPE_PRIMARY, NULL);
	if (ret) {
		drm_err(dev, "drm_universal_plane_init() failed: %d\n", ret);
		return ret;
	}
	drm_plane_helper_add(primary_plane, &mgag200_g200eh5_primary_plane_helper_funcs);
	drm_plane_enable_fb_damage_clips(primary_plane);

	ret = drm_crtc_init_with_planes(dev, crtc, primary_plane, NULL,
					&mgag200_g200eh5_crtc_funcs, NULL);
	if (ret) {
		drm_err(dev, "drm_crtc_init_with_planes() failed: %d\n", ret);
		return ret;
	}

	drm_crtc_helper_add(crtc, &mgag200_g200eh5_crtc_helper_funcs);

	/* FIXME: legacy gamma tables, but atomic gamma doesn't work without */
	drm_mode_crtc_set_gamma_size(crtc, MGAG200_LUT_SIZE);
	drm_crtc_enable_color_mgmt(crtc, 0, false, MGAG200_LUT_SIZE);
	ret = mgag200_vga_bmc_output_init(mdev);

	if (ret)
		return ret;

	return 0;
}

/*
 * DRM device
 */

static const struct mgag200_device_info mgag200_g200eh5_device_info =

Annotation

Implementation Notes