KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(30)

本文详细探讨了KWin、libdrm、DRM框架下,从drm_mode_addFBxxx系列函数到drm_gem_open函数的流程。文章通过源码分析,解释了drm_file_alloc、drm_gem_open函数的工作原理,特别是如何通过drm_minor_acquire、idr_find等函数获取和使用minor及dev。最后,文章指出drm_minors_idr的初始化和分配过程,为理解整个系统运作提供了清晰的线索。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

接前一篇文章:KWin、libdrm、DRM从上到下全过程 —— drmModeAddFBxxx(29)

上一回解析了drm_gem_open函数的上游函数drm_file_alloc函数。本回正式开始对于drm_gem_open函数进行解析。为了便于理解,再次贴出drm_file_alloc函数和drm_gem_open函数源码。

  • drm_file_alloc函数

drm_file_alloc函数在drivers/gpu/drm/drm_file.c中,代码如下:

/**
 * drm_file_alloc - allocate file context
 * @minor: minor to allocate on
 *
 * This allocates a new DRM file context. It is not linked into any context and
 * can be used by the caller freely. Note that the context keeps a pointer to
 * @minor, so it must be freed before @minor is.
 *
 * RETURNS:
 * Pointer to newly allocated context, ERR_PTR on fa
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

蓝天居士

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值