[PATCH] drm/lima: fix wait pp reset timeout
PP bcast is marked as doing async reset after job is done. When resume after suspend, each PP is reset individually, so no need to reset in PP bcast resume. But I forgot to clear the PP bcast async reset mark so call into async wait before job run and gets timeout. Fixes: 3446d7e9883d ("drm/lima: add resume/suspend callback for each ip") Signed-off-by: Qiang Yu --- drivers/gpu/drm/lima/lima_pp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c index 33f01383409c..a5c95bed08c0 100644 --- a/drivers/gpu/drm/lima/lima_pp.c +++ b/drivers/gpu/drm/lima/lima_pp.c @@ -271,6 +271,8 @@ void lima_pp_fini(struct lima_ip *ip) int lima_pp_bcast_resume(struct lima_ip *ip) { + /* PP has been reset by individual PP resume */ + ip->data.async_reset = false; return 0; } -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 09/19] backlight: drop extern from prototypes
No need to put "extern" in front of prototypes. While touching the prototypes adjust indent to follow the kernel style. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 35 +++ 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 8f2005a6f8a9..c6ac4cbb9ddb 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -417,23 +417,26 @@ static inline bool backlight_is_blank(const struct backlight_device *bd) bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK); } -extern struct backlight_device *backlight_device_register(const char *name, - struct device *dev, void *devdata, const struct backlight_ops *ops, - const struct backlight_properties *props); -extern struct backlight_device *devm_backlight_device_register( - struct device *dev, const char *name, struct device *parent, - void *devdata, const struct backlight_ops *ops, - const struct backlight_properties *props); -extern void backlight_device_unregister(struct backlight_device *bd); -extern void devm_backlight_device_unregister(struct device *dev, - struct backlight_device *bd); -extern void backlight_force_update(struct backlight_device *bd, - enum backlight_update_reason reason); -extern int backlight_register_notifier(struct notifier_block *nb); -extern int backlight_unregister_notifier(struct notifier_block *nb); -extern struct backlight_device *backlight_device_get_by_type(enum backlight_type type); +struct backlight_device * +backlight_device_register(const char *name, struct device *dev, void *devdata, + const struct backlight_ops *ops, + const struct backlight_properties *props); +struct backlight_device * +devm_backlight_device_register(struct device *dev, const char *name, + struct device *parent, void *devdata, + const struct backlight_ops *ops, + const struct backlight_properties *props); +void backlight_device_unregister(struct backlight_device *bd); +void devm_backlight_device_unregister(struct device *dev, + struct backlight_device *bd); +void backlight_force_update(struct backlight_device *bd, + enum backlight_update_reason reason); +int backlight_register_notifier(struct notifier_block *nb); +int backlight_unregister_notifier(struct notifier_block *nb); struct backlight_device *backlight_device_get_by_name(const char *name); -extern int backlight_device_set_brightness(struct backlight_device *bd, unsigned long brightness); +struct backlight_device *backlight_device_get_by_type(enum backlight_type type); +int backlight_device_set_brightness(struct backlight_device *bd, + unsigned long brightness); #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 05/19] backlight: improve backlight_device documentation
Improve the documentation for backlight_device and adapt it to kernel-doc style. The updated documentation is more strict on how locking is used. With the update neither update_lock nor ops_lock may be used outside the backlight core. This restriction was introduced to keep the locking simple by keeping it in the core. It was verified that this documents the current state by renaming update_lock => bl_update_lock and ops_lock => bl_ops_lock. The rename did not reveal any uses outside the backlight core. The rename is NOT part of this patch. v3: - Update changelog to explain locking details (Daniel) v2: - Add short intro to all fields (Daniel) - Updated description of update_lock (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Emil Velikov Reviewed-by: Daniel Thompson Reviewed-by: Jingoo Han Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 72 ++- 1 file changed, 49 insertions(+), 23 deletions(-) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 10518b00b059..7654fe5f1589 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -14,21 +14,6 @@ #include #include -/* Notes on locking: - * - * backlight_device->ops_lock is an internal backlight lock protecting the - * ops pointer and no code outside the core should need to touch it. - * - * Access to update_status() is serialised by the update_lock mutex since - * most drivers seem to need this and historically get it wrong. - * - * Most drivers don't need locking on their get_brightness() method. - * If yours does, you need to implement it in the driver. You can use the - * update_lock mutex if appropriate. - * - * Any other use of the locks below is probably wrong. - */ - enum backlight_update_reason { BACKLIGHT_UPDATE_HOTKEY, BACKLIGHT_UPDATE_SYSFS, @@ -215,30 +200,71 @@ struct backlight_properties { enum backlight_scale scale; }; +/** + * struct backlight_device - backlight device data + * + * This structure holds all data required by a backlight device. + */ struct backlight_device { - /* Backlight properties */ + /** +* @props: Backlight properties +*/ struct backlight_properties props; - /* Serialise access to update_status method */ + /** +* @update_lock: The lock used when calling the update_status() operation. +* +* update_lock is an internal backlight lock that serialise access +* to the update_status() operation. The backlight core holds the update_lock +* when calling the update_status() operation. The update_lock shall not +* be used by backlight drivers. +*/ struct mutex update_lock; - /* This protects the 'ops' field. If 'ops' is NULL, the driver that - registered this device has been unloaded, and if class_get_devdata() - points to something in the body of that driver, it is also invalid. */ + /** +* @ops_lock: The lock used around everything related to backlight_ops. +* +* ops_lock is an internal backlight lock that protects the ops pointer +* and is used around all accesses to ops and when the operations are +* invoked. The ops_lock shall not be used by backlight drivers. +*/ struct mutex ops_lock; + + /** +* @ops: Pointer to the backlight operations. +* +* If ops is NULL, the driver that registered this device has been unloaded, +* and if class_get_devdata() points to something in the body of that driver, +* it is also invalid. +*/ const struct backlight_ops *ops; - /* The framebuffer notifier block */ + /** +* @fb_notif: The framebuffer notifier block +*/ struct notifier_block fb_notif; - /* list entry of all registered backlight devices */ + /** +* @entry: List entry of all registered backlight devices +*/ struct list_head entry; + /** +* @dev: Parent device. +*/ struct device dev; - /* Multiple framebuffers may share one backlight device */ + /** +* @fb_bl_on: The state of individual fbdev's. +* +* Multiple fbdev's may share one backlight device. The fb_bl_on +* records the state of the individual fbdev. +*/ bool fb_bl_on[FB_MAX]; + /** +* @use_count: The number of uses of fb_bl_on. +*/ int use_count; }; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 01/19] backlight: refactor fb_notifier_callback()
Increase readability of fb_notifier_callback() by removing a few indent levels. No functional change. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/backlight.c | 43 +++-- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 744ba58488e0..18501956dd87 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -58,28 +58,29 @@ static int fb_notifier_callback(struct notifier_block *self, bd = container_of(self, struct backlight_device, fb_notif); mutex_lock(&bd->ops_lock); - if (bd->ops) - if (!bd->ops->check_fb || - bd->ops->check_fb(bd, evdata->info)) { - fb_blank = *(int *)evdata->data; - if (fb_blank == FB_BLANK_UNBLANK && - !bd->fb_bl_on[node]) { - bd->fb_bl_on[node] = true; - if (!bd->use_count++) { - bd->props.state &= ~BL_CORE_FBBLANK; - bd->props.fb_blank = FB_BLANK_UNBLANK; - backlight_update_status(bd); - } - } else if (fb_blank != FB_BLANK_UNBLANK && - bd->fb_bl_on[node]) { - bd->fb_bl_on[node] = false; - if (!(--bd->use_count)) { - bd->props.state |= BL_CORE_FBBLANK; - bd->props.fb_blank = fb_blank; - backlight_update_status(bd); - } - } + + if (!bd->ops) + goto out; + if (bd->ops->check_fb && !bd->ops->check_fb(bd, evdata->info)) + goto out; + + fb_blank = *(int *)evdata->data; + if (fb_blank == FB_BLANK_UNBLANK && !bd->fb_bl_on[node]) { + bd->fb_bl_on[node] = true; + if (!bd->use_count++) { + bd->props.state &= ~BL_CORE_FBBLANK; + bd->props.fb_blank = FB_BLANK_UNBLANK; + backlight_update_status(bd); + } + } else if (fb_blank != FB_BLANK_UNBLANK && bd->fb_bl_on[node]) { + bd->fb_bl_on[node] = false; + if (!(--bd->use_count)) { + bd->props.state |= BL_CORE_FBBLANK; + bd->props.fb_blank = fb_blank; + backlight_update_status(bd); } + } +out: mutex_unlock(&bd->ops_lock); return 0; } -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 19/19] backlight: make of_find_backlight static
There are no external users of of_find_backlight, as they have all changed to use the managed version. Make of_find_backlight static to prevent new external users. v3: - Move doc for devm_of_find_backlight out of this patch v2: - Editorial corrections (Daniel) - Returns => RETURNS (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/backlight.c | 18 +- include/linux/backlight.h | 6 -- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index d8387c8e7112..ff8406a15545 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -673,22 +673,7 @@ struct backlight_device *of_find_backlight_by_node(struct device_node *node) EXPORT_SYMBOL(of_find_backlight_by_node); #endif -/** - * of_find_backlight - Get backlight device - * @dev: Device - * - * This function looks for a property named 'backlight' on the DT node - * connected to @dev and looks up the backlight device. - * - * Call backlight_put() to drop the reference on the backlight device. - * - * Returns: - * A pointer to the backlight device if found. - * Error pointer -EPROBE_DEFER if the DT property is set, but no backlight - * device is found. - * NULL if there's no backlight property. - */ -struct backlight_device *of_find_backlight(struct device *dev) +static struct backlight_device *of_find_backlight(struct device *dev) { struct backlight_device *bd = NULL; struct device_node *np; @@ -714,7 +699,6 @@ struct backlight_device *of_find_backlight(struct device *dev) return bd; } -EXPORT_SYMBOL(of_find_backlight); static void devm_backlight_release(void *data) { diff --git a/include/linux/backlight.h b/include/linux/backlight.h index f3b484c99789..8b43fd90d84a 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -477,14 +477,8 @@ of_find_backlight_by_node(struct device_node *node) #endif #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) -struct backlight_device *of_find_backlight(struct device *dev); struct backlight_device *devm_of_find_backlight(struct device *dev); #else -static inline struct backlight_device *of_find_backlight(struct device *dev) -{ - return NULL; -} - static inline struct backlight_device * devm_of_find_backlight(struct device *dev) { -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 07/19] backlight: document enums in backlight.h
Add kernel-doc documentation for the backlight enums v2: - Add intro to each enum member (Daniel) Except backlight type as line lenght was too long. The generated HTML is the same. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 72 +++ 1 file changed, 72 insertions(+) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 7d6cb61e10f5..0f425b32e6be 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -14,26 +14,98 @@ #include #include +/** + * enum backlight_update_reason - what method was used to update backlight + * + * A driver indicates the method (reason) used for updating the backlight + * when calling backlight_force_update(). + */ enum backlight_update_reason { + /** +* @BACKLIGHT_UPDATE_HOTKEY: The backlight was updated using a hot-key. +*/ BACKLIGHT_UPDATE_HOTKEY, + + /** +* @BACKLIGHT_UPDATE_SYSFS: The backlight was updated using sysfs. +*/ BACKLIGHT_UPDATE_SYSFS, }; +/** + * enum backlight_type - the type of backlight control + * + * The type of interface used to control the backlight. + */ enum backlight_type { + /** +* @BACKLIGHT_RAW: +* +* The backlight is controlled using hardware registers. +*/ BACKLIGHT_RAW = 1, + + /** +* @BACKLIGHT_PLATFORM: +* +* The backlight is controlled using a platform-specific interface. +*/ BACKLIGHT_PLATFORM, + + /** +* @BACKLIGHT_FIRMWARE: +* +* The backlight is controlled using a standard firmware interface. +*/ BACKLIGHT_FIRMWARE, + + /** +* @BACKLIGHT_TYPE_MAX: Number of entries. +*/ BACKLIGHT_TYPE_MAX, }; +/** + * enum backlight_notification - the type of notification + * + * The notifications that is used for notification sent to the receiver + * that registered notifications using backlight_register_notifier(). + */ enum backlight_notification { + /** +* @BACKLIGHT_REGISTERED: The backlight device is registered. +*/ BACKLIGHT_REGISTERED, + + /** +* @BACKLIGHT_UNREGISTERED: The backlight revice is unregistered. +*/ BACKLIGHT_UNREGISTERED, }; +/** enum backlight_scale - the type of scale used for brightness values + * + * The type of scale used for brightness values. + */ enum backlight_scale { + /** +* @BACKLIGHT_SCALE_UNKNOWN: The scale is unknown. +*/ BACKLIGHT_SCALE_UNKNOWN = 0, + + /** +* @BACKLIGHT_SCALE_LINEAR: The scale is linear. +* +* The linear scale will increase brightness the same for each step. +*/ BACKLIGHT_SCALE_LINEAR, + + /** +* @BACKLIGHT_SCALE_NON_LINEAR: The scale is not linear. +* +* This is often used when the brightness values tries to adjust to +* the relative perception of the eye demanding a non-linear scale. +*/ BACKLIGHT_SCALE_NON_LINEAR, }; -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 17/19] backlight: use backlight_get_brightness()
Introduce the backlight_get_brightness() helper in all video/backlight/* drivers. This simplifies the code and align the implementation of the update_status() operation across the different backlight drivers. Some of the drivers gains a little extra functionality by the change as they now respect the fb_blank() ioctl. v2: - Fix spelling in subject (Uwe) Signed-off-by: Sam Ravnborg Cc: Uwe Kleine-König Reviewed-by: Daniel Thompson --- drivers/video/backlight/88pm860x_bl.c | 13 + drivers/video/backlight/adp5520_bl.c | 10 +- drivers/video/backlight/adp8860_bl.c | 10 +- drivers/video/backlight/adp8870_bl.c | 10 +- drivers/video/backlight/bd6107.c | 7 +-- drivers/video/backlight/corgi_lcd.c | 8 +--- drivers/video/backlight/da903x_bl.c | 13 + drivers/video/backlight/ep93xx_bl.c | 8 +--- drivers/video/backlight/hp680_bl.c| 6 +- drivers/video/backlight/kb3886_bl.c | 6 +- drivers/video/backlight/led_bl.c | 7 +-- drivers/video/backlight/lm3533_bl.c | 8 +--- drivers/video/backlight/locomolcd.c | 6 +- drivers/video/backlight/lv5207lp.c| 7 +-- drivers/video/backlight/max8925_bl.c | 13 + drivers/video/backlight/pwm_bl.c | 7 +-- drivers/video/backlight/qcom-wled.c | 7 +-- drivers/video/backlight/tps65217_bl.c | 10 +- drivers/video/backlight/wm831x_bl.c | 13 + 19 files changed, 19 insertions(+), 150 deletions(-) diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index 20d96a5ac384..25e409bbb1a2 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c @@ -121,18 +121,7 @@ static int pm860x_backlight_set(struct backlight_device *bl, int brightness) static int pm860x_backlight_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.state & BL_CORE_SUSPENDED) - brightness = 0; - - return pm860x_backlight_set(bl, brightness); + return pm860x_backlight_set(bl, backlight_get_brightness(bl)); } static int pm860x_backlight_get_brightness(struct backlight_device *bl) diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index 0f63f76723a5..686988c3df3a 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c @@ -65,15 +65,7 @@ static int adp5520_bl_set(struct backlight_device *bl, int brightness) static int adp5520_bl_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - return adp5520_bl_set(bl, brightness); + return adp5520_bl_set(bl, backlight_get_brightness(bl)); } static int adp5520_bl_get_brightness(struct backlight_device *bl) diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c index 19968104fc47..ddc7f5f0401f 100644 --- a/drivers/video/backlight/adp8860_bl.c +++ b/drivers/video/backlight/adp8860_bl.c @@ -361,15 +361,7 @@ static int adp8860_bl_set(struct backlight_device *bl, int brightness) static int adp8860_bl_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - return adp8860_bl_set(bl, brightness); + return adp8860_bl_set(bl, backlight_get_brightness(bl)); } static int adp8860_bl_get_brightness(struct backlight_device *bl) diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c index 4c0032010cfe..8b5213a39527 100644 --- a/drivers/video/backlight/adp8870_bl.c +++ b/drivers/video/backlight/adp8870_bl.c @@ -399,15 +399,7 @@ static int adp8870_bl_set(struct backlight_device *bl, int brightness) static int adp8870_bl_update_status(struct backlight_device *bl) { - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK) - brightness = 0; - - if (bl->props.fb_blank != FB_BLANK_UNBLANK) - brightness = 0; - - return adp8870_bl_set(bl, brightness); + return adp8870_bl_set(bl, backlight_get_brightness(bl)); } static int adp8870_bl_get_brightness(struct backlight_device *bl) diff --git a/drivers/video/backlight/bd6107.c b/drivers/video/backlight/bd6107.c index d5d5fb457e78..515184fbe33a 100644 --- a/drivers/video/backlight/bd6107.c +++ b/drivers/video/backlight/bd6107.c @@ -82,12 +82,7 @@ static int bd
[PATCH v5 04/19] backlight: improve backlight_properties documentation
Improve the documentation for backlight_properties and adapt it to kernel-doc style. v3: - Added missing '@' in kernel-doc v2: - Added into for each field (Daniel) - Re-written some parts to explain what to do, rather than what not to do. Partly based on suggestions from the review (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 96 ++- 1 file changed, 85 insertions(+), 11 deletions(-) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index dfb43ee02ea0..10518b00b059 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -117,28 +117,102 @@ struct backlight_ops { int (*check_fb)(struct backlight_device *bd, struct fb_info *info); }; -/* This structure defines all the properties of a backlight */ +/** + * struct backlight_properties - backlight properties + * + * This structure defines all the properties of a backlight. + */ struct backlight_properties { - /* Current User requested brightness (0 - max_brightness) */ + /** +* @brightness: The current brightness requested by the user. +* +* The backlight core makes sure the range is (0 to max_brightness) +* when the brightness is set via the sysfs attribute: +* /sys/class/backlight//brightness. +* +* This value can be set in the backlight_properties passed +* to devm_backlight_device_register() to set a default brightness +* value. +*/ int brightness; - /* Maximal value for brightness (read-only) */ + + /** +* @max_brightness: The maximum brightness value. +* +* This value must be set in the backlight_properties passed to +* devm_backlight_device_register() and shall not be modified by the +* driver after registration. +*/ int max_brightness; - /* Current FB Power mode (0: full on, 1..3: power saving - modes; 4: full off), see FB_BLANK_XXX */ + + /** +* @power: The current power mode. +* +* User space can configure the power mode using the sysfs +* attribute: /sys/class/backlight//bl_power +* When the power property is updated update_status() is called. +* +* The possible values are: (0: full on, 1 to 3: power saving +* modes; 4: full off), see FB_BLANK_XXX. +* +* When the backlight device is enabled @power is set +* to FB_BLANK_UNBLANK. When the backlight device is disabled +* @power is set to FB_BLANK_POWERDOWN. +*/ int power; - /* FB Blanking active? (values as for power) */ - /* Due to be removed, please use (state & BL_CORE_FBBLANK) */ + + /** +* @fb_blank: The power state from the FBIOBLANK ioclt. +* +* When the FBIOBLANK ioctl is called @fb_blank is set to the +* blank parameter and the update_status() operation is called. +* +* When the backlight device is enabled @fb_blank is set +* to FB_BLANK_UNBLANK. When the backlight device is disabled +* @fb_blank is set to FB_BLANK_POWERDOWN. +* +* Backlight drivers should avoid using this property. It has been +* replaced by state & BL_CORE_FBLANK (although most drivers should +* use backlight_is_blank() as the preferred means to get the blank +* state). +* +* fb_blank is deprecated and will be removed. +*/ int fb_blank; - /* Backlight type */ + + /** +* @type: The type of backlight supported. +* +* The backlight type allows userspace to make appropriate +* policy desicions based on the backlight type. +* +* This value must be set in the backlight_properties +* passed to devm_backlight_device_register(). +*/ enum backlight_type type; - /* Flags used to signal drivers of state changes */ + + /** +* @state: The state of the backlight core. +* +* The state is a bitmask. BL_CORE_FBBLANK is set when the display +* is expected to be blank. BL_CORE_SUSPENDED is set when the +* driver is suspended. +* +* backlight drivers are excpected to use backlight_is_blank() +* in their update_status() operation rather than reading the +* state property. +* +* The state is maintained by the core and drivers may not modify it. +*/ unsigned int state; - /* Type of the brightness scale (linear, non-linear, ...) */ - enum backlight_scale scale; #define BL_CORE_SUSPENDED (1 << 0)/* backlight is suspended */ #define BL_CORE_FBBLANK(1 << 1)/* backlight is under an fb blank event */ + /** +* @sca
[PATCH v5 16/19] backlight: jornada720_bl: introduce backlight_is_blank()
Use the backlight_is_blank() helper to simplify the code a bit. The jornada720_bl driver distingush between backlight off and brightness set to 0. Thus this driver turn off backlight only when backlight_is_blank() returns true. v2: - Updated changelog (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/jornada720_bl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c index f0385f9cf9da..996f7ba3b373 100644 --- a/drivers/video/backlight/jornada720_bl.c +++ b/drivers/video/backlight/jornada720_bl.c @@ -54,7 +54,7 @@ static int jornada_bl_update_status(struct backlight_device *bd) jornada_ssp_start(); /* If backlight is off then really turn it off */ - if ((bd->props.power != FB_BLANK_UNBLANK) || (bd->props.fb_blank != FB_BLANK_UNBLANK)) { + if (backlight_is_blank(bd)) { ret = jornada_ssp_byte(BRIGHTNESSOFF); if (ret != TXDUMMY) { dev_info(&bd->dev, "brightness off timeout\n"); -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 12/19] backlight: introduce backlight_get_brightness()
Based on an idea from Emil Velikov add a helper that checks backlight_is_blank() and return 0 as brightness if display is blank or the property value if not. This allows us to simplify the update_status() implementation in most of the backlight drivers. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index c6ac4cbb9ddb..38db67588b16 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -417,6 +417,25 @@ static inline bool backlight_is_blank(const struct backlight_device *bd) bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK); } +/** + * backlight_get_brightness - Returns the current brightness value + * @bd: the backlight device + * + * Returns the current brightness value, taking in consideration the current + * state. If backlight_is_blank() returns true then return 0 as brightness + * otherwise return the current brightness property value. + * + * Backlight drivers are expected to use this function in their update_status() + * operation to get the brightness value. + */ +static inline int backlight_get_brightness(const struct backlight_device *bd) +{ + if (backlight_is_blank(bd)) + return 0; + else + return bd->props.brightness; +} + struct backlight_device * backlight_device_register(const char *name, struct device *dev, void *devdata, const struct backlight_ops *ops, -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 15/19] backlight: gpio_backlight: simplify update_status()
Introduce the use of backlight_get_brightness() to simplify the update_status() operation. With the simpler implementation drop the gpio_backlight_get_next_brightness() helper as it was now a one-liner. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/gpio_backlight.c | 17 ++--- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/drivers/video/backlight/gpio_backlight.c b/drivers/video/backlight/gpio_backlight.c index 75409ddfba3e..6f78d928f054 100644 --- a/drivers/video/backlight/gpio_backlight.c +++ b/drivers/video/backlight/gpio_backlight.c @@ -21,24 +21,11 @@ struct gpio_backlight { struct gpio_desc *gpiod; }; -static int gpio_backlight_get_next_brightness(struct backlight_device *bl) -{ - int brightness = bl->props.brightness; - - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK || - bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) - brightness = 0; - - return brightness; -} - static int gpio_backlight_update_status(struct backlight_device *bl) { struct gpio_backlight *gbl = bl_get_data(bl); - int brightness = gpio_backlight_get_next_brightness(bl); - gpiod_set_value_cansleep(gbl->gpiod, brightness); + gpiod_set_value_cansleep(gbl->gpiod, backlight_get_brightness(bl)); return 0; } @@ -108,7 +95,7 @@ static int gpio_backlight_probe(struct platform_device *pdev) bl->props.brightness = 1; - init_brightness = gpio_backlight_get_next_brightness(bl); + init_brightness = backlight_get_brightness(bl); ret = gpiod_direction_output(gbl->gpiod, init_brightness); if (ret) { dev_err(dev, "failed to set initial brightness\n"); -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 02/19] backlight: add backlight_is_blank()
The backlight support has three properties that express the state: - power - state - fb_blank It is un-documented and easy to get wrong. Add backlight_is_blank() helper to make it simpler for drivers to get the check of the state correct. A lot of drivers also includes checks for fb_blank. This check is redundant when the state is checked and thus not needed in this helper function. But added anyway to avoid introducing subtle bugs due to the creative use of fb_blank in some drivers. Introducing this helper will for some drivers results in added support for fb_blank. This will be a change in functionality, which will improve the backlight driver. Rolling out this helper to all relevant backlight drivers will eliminate almost all accesses to fb_blank. v5: - Improved changelog, added fb_blank to properties that express state (Daniel) v4: - struct backlight_device * is now const v3: - Clarified that the fb_blank support in backlight_is_blank() may result in functionality changes for the users (Emil) v2: - Added fb_blank condition (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Peter Ujfalusi Reviewed-by: Emil Velikov Reviewed-by: Daniel Vetter Cc: Emil Velikov Cc: Daniel Vetter Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 19 +++ 1 file changed, 19 insertions(+) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 56e4580d4f55..56e51ebab740 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -175,6 +175,25 @@ static inline void backlight_put(struct backlight_device *bd) put_device(&bd->dev); } +/** + * backlight_is_blank - Return true if display is expected to be blank + * @bd: the backlight device + * + * Display is expected to be blank if any of these is true:: + * + * 1) if power in not UNBLANK + * 2) if fb_blank is not UNBLANK + * 3) if state indicate BLANK or SUSPENDED + * + * Returns true if display is expected to be blank, false otherwise. + */ +static inline bool backlight_is_blank(const struct backlight_device *bd) +{ + return bd->props.power != FB_BLANK_UNBLANK || + bd->props.fb_blank != FB_BLANK_UNBLANK || + bd->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK); +} + extern struct backlight_device *backlight_device_register(const char *name, struct device *dev, void *devdata, const struct backlight_ops *ops, const struct backlight_properties *props); -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 03/19] backlight: improve backlight_ops documentation
Improve the documentation for backlight_ops and adapt it to kernel-doc style. v2: - Add intro for each field (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 59 +++ 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 56e51ebab740..dfb43ee02ea0 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -55,19 +55,66 @@ enum backlight_scale { struct backlight_device; struct fb_info; +/** + * struct backlight_ops - backlight operations + * + * The backlight operations are specifed when the backlight device is registered. + */ struct backlight_ops { + /** +* @options: Configure how operations are called from the core. +* +* The options parameter is used to adjust the behaviour of the core. +* Set BL_CORE_SUSPENDRESUME to get the update_status() operation called +* upon suspend and resume. +*/ unsigned int options; #define BL_CORE_SUSPENDRESUME (1 << 0) - /* Notify the backlight driver some property has changed */ + /** +* @update_status: Operation called when properties have changed. +* +* Notify the backlight driver some property has changed. +* The update_status operation is protected by the update_lock. +* +* The backlight driver is expected to use backlight_is_blank() +* to check if the display is blanked and set brightness accordingly. +* update_status() is called when any of the properties has changed. +* +* RETURNS: +* +* 0 on sucees, negative error code if any failure occured. +*/ int (*update_status)(struct backlight_device *); - /* Return the current backlight brightness (accounting for power, - fb_blank etc.) */ + + /** +* @get_brightness: Return the current backlight brightness. +* +* The driver may implement this as a readback from the HW. +* This operation is optional and if not present then the current +* brightness property value is used. +* +* RETURNS: +* +* A brightness value which is 0 or a positive numer. +* On failure a negative error code is returned. +*/ int (*get_brightness)(struct backlight_device *); - /* Check if given framebuffer device is the one bound to this backlight; - return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ - int (*check_fb)(struct backlight_device *, struct fb_info *); + + /** +* @check_fb: Check the framebuffer device. +* +* Check if given framebuffer device is the one bound to this backlight. +* This operation is optional and if not implemented it is assumed that the +* fbdev is always the one bound to the backlight. +* +* RETURNS: +* +* If info is NULL or the info matches the fbdev bound to the backlight return true. +* If info does not match the fbdev bound to the backlight return false. +*/ + int (*check_fb)(struct backlight_device *bd, struct fb_info *info); }; /* This structure defines all the properties of a backlight */ -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 13/19] backlight: as3711_bl: simplify update_status
Replaces the open-coded checks of the state, with the backlight_get_brightness() helper. This increases readability of the code and align the functionality across the drivers. Futhermore drop the debug prints in update_status(). If we need debug printing then we can add it to the backlight core. v2: - Use backlight_get_brightness() Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han Cc: Emil Velikov --- drivers/video/backlight/as3711_bl.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/drivers/video/backlight/as3711_bl.c b/drivers/video/backlight/as3711_bl.c index 33f0f0f2e8b3..3b60019cdc2b 100644 --- a/drivers/video/backlight/as3711_bl.c +++ b/drivers/video/backlight/as3711_bl.c @@ -104,17 +104,10 @@ static int as3711_bl_update_status(struct backlight_device *bl) struct as3711_bl_data *data = bl_get_data(bl); struct as3711_bl_supply *supply = to_supply(data); struct as3711 *as3711 = supply->as3711; - int brightness = bl->props.brightness; + int brightness; int ret = 0; - dev_dbg(&bl->dev, "%s(): brightness %u, pwr %x, blank %x, state %x\n", - __func__, bl->props.brightness, bl->props.power, - bl->props.fb_blank, bl->props.state); - - if (bl->props.power != FB_BLANK_UNBLANK || - bl->props.fb_blank != FB_BLANK_UNBLANK || - bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) - brightness = 0; + brightness = backlight_get_brightness(bl); if (data->type == AS3711_BL_SU1) { ret = as3711_set_brightness_v(as3711, brightness, -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 0/19] backlight: backlight updates
Hi all. Follow-up on v4 - with only a few changes listed below and in the individual patches. Thanks for all the reviews and the feedback on the patches! I am planning a follow-up on this patchset to update the backlight drivers all over to use backlight_get_brightness() and backlight_is_blank() as appropriate. v5: - Added r-b's - Updated cr_bllcd to use gpio-backlight semantics - Various editorial updates to changelogs - Rebased on top of Lee's backlight tree - Dropped "make of_find_backlight_by_node() static" The change depends on drm-misc-next. Will be re-send when the changes hits the backlight tree (We could have done this in other ways, but it is easier to just wait) v4: - Introduced backlight_get_brightness based on feedback from Emil. - Properly described the rationale behind more restrictive locking use I checked that locking was not used outside backlight core by renaming the lock fields. As it is not used seems OK to restrict use to the core. - Introducing backlight_get_brightness invalidated some patches and I did a bit finer split to ease review. - Added acks - A few small adjustments documented in the individual patches v3: - Dropped video patch that was reviewd and thus applied - Updated kernel-doc so all fields now have a short intro - Improved readability in a lot of places, thanks to review feedback from Daniel - thanks! - Added better intro to backlight - Added acks Several other smaller changes documented in the patches. I left out patches to make functions static as there are dependencies to drm-misc-next for these. v2: - Dropped drm patches that was reviewed and thus applied (Thanks Tomi) - Updated backligth_is_blank() based on Daniel's feedback - Dropped EXPORT_SYMBOL that was no longer relevant - Reordered patches, so patches with no external dependencies comes first - Updated the description that follows. The following series touches a lot of backlight things. Starts with a small refactoring in backligth.c to remove some indents. This increases the readability and no functional changes. Then two new helpers backlight_is_blank(), backlight_get_brightness() are added. These helpers simplifies the implementation of update_status() in the backlight drivers where they are used. Then while surfing the code I missed some documentation. So I got a bit carried away and updated the documentation for the backlight core and added it to kernel-doc. The documentation express my current understanding. Everything from spelling errors to outright wrong content shall be anticipated - so please review! We are all best helped if the documentation is correct and up-to-date and it is readable. In this process I identified that the backlight_bl driver was no longer in use - so drop it. Everything builds, but so far no run-time testing. Sam Sam Ravnborg (19): backlight: refactor fb_notifier_callback() backlight: add backlight_is_blank() backlight: improve backlight_ops documentation backlight: improve backlight_properties documentation backlight: improve backlight_device documentation backlight: document inline functions in backlight.h backlight: document enums in backlight.h backlight: remove the unused backlight_bl driver backlight: drop extern from prototypes backlight: add overview and update existing doc backlight: wire up kernel-doc documentation backlight: introduce backlight_get_brightness() backlight: as3711_bl: simplify update_status backlight: cr_bllcd: introduce gpio-backlight semantics backlight: gpio_backlight: simplify update_status() backlight: jornada720_bl: introduce backlight_is_blank() backlight: use backlight_get_brightness() backlight: drop backlight_put() backlight: make of_find_backlight static Documentation/gpu/backlight.rst | 12 + Documentation/gpu/index.rst | 1 + drivers/video/backlight/88pm860x_bl.c| 13 +- drivers/video/backlight/Kconfig | 8 - drivers/video/backlight/Makefile | 1 - drivers/video/backlight/adp5520_bl.c | 10 +- drivers/video/backlight/adp8860_bl.c | 10 +- drivers/video/backlight/adp8870_bl.c | 10 +- drivers/video/backlight/as3711_bl.c | 11 +- drivers/video/backlight/backlight.c | 208 +--- drivers/video/backlight/bd6107.c | 7 +- drivers/video/backlight/corgi_lcd.c | 8 +- drivers/video/backlight/cr_bllcd.c | 25 +- drivers/video/backlight/da903x_bl.c | 13 +- drivers/video/backlight/ep93xx_bl.c | 8 +- drivers/video/backlight/generic_bl.c | 110 - drivers/video/backlight/gpio_backlight.c | 17 +- drivers/video/backlight/hp680_bl.c | 6 +- drivers/video/backlight/jornada720_bl.c | 2 +- drivers/video/backlight/kb3886_bl.c | 6 +- drivers/video/backlight/led_bl.c |
[PATCH v5 11/19] backlight: wire up kernel-doc documentation
Include backlight so the documentation is now generated with make htmldocs and friends. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: Jonathan Corbet --- Documentation/gpu/backlight.rst | 12 Documentation/gpu/index.rst | 1 + 2 files changed, 13 insertions(+) create mode 100644 Documentation/gpu/backlight.rst diff --git a/Documentation/gpu/backlight.rst b/Documentation/gpu/backlight.rst new file mode 100644 index ..9ebfc9d0aced --- /dev/null +++ b/Documentation/gpu/backlight.rst @@ -0,0 +1,12 @@ += +Backlight support += + +.. kernel-doc:: drivers/video/backlight/backlight.c + :doc: overview + +.. kernel-doc:: include/linux/backlight.h + :internal: + +.. kernel-doc:: drivers/video/backlight/backlight.c + :export: diff --git a/Documentation/gpu/index.rst b/Documentation/gpu/index.rst index 1fcf8e851e15..c9a51e3bfb5a 100644 --- a/Documentation/gpu/index.rst +++ b/Documentation/gpu/index.rst @@ -12,6 +12,7 @@ Linux GPU Driver Developer's Guide drm-uapi drm-client drivers + backlight vga-switcheroo vgaarbiter todo -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 06/19] backlight: document inline functions in backlight.h
Add documentation for the inline functions in backlight.h v2: - Fix spelling (Daniel) Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- include/linux/backlight.h | 16 1 file changed, 16 insertions(+) diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 7654fe5f1589..7d6cb61e10f5 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -268,6 +268,10 @@ struct backlight_device { int use_count; }; +/** + * backlight_update_status - force an update of the backlight device status + * @bd: the backlight device + */ static inline int backlight_update_status(struct backlight_device *bd) { int ret = -ENOENT; @@ -361,6 +365,18 @@ extern int backlight_device_set_brightness(struct backlight_device *bd, unsigned #define to_backlight_device(obj) container_of(obj, struct backlight_device, dev) +/** + * bl_get_data - access devdata + * @bl_dev: pointer to backlight device + * + * When a backlight device is registered the driver has the possibility + * to supply a void * devdata. bl_get_data() return a pointer to the + * devdata. + * + * RETURNS: + * + * pointer to devdata stored while registering the backlight device. + */ static inline void * bl_get_data(struct backlight_device *bl_dev) { return dev_get_drvdata(&bl_dev->dev); -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 18/19] backlight: drop backlight_put()
There are no external users of backlight_put(). Drop it and open code the two users in backlight.c. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/backlight.c | 7 +-- include/linux/backlight.h | 10 -- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 93ae8c63fe4c..d8387c8e7112 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -718,7 +718,10 @@ EXPORT_SYMBOL(of_find_backlight); static void devm_backlight_release(void *data) { - backlight_put(data); + struct backlight_device *bd = data; + + if (bd) + put_device(&bd->dev); } /** @@ -746,7 +749,7 @@ struct backlight_device *devm_of_find_backlight(struct device *dev) return bd; ret = devm_add_action(dev, devm_backlight_release, bd); if (ret) { - backlight_put(bd); + put_device(&bd->dev); return ERR_PTR(ret); } return bd; diff --git a/include/linux/backlight.h b/include/linux/backlight.h index 38db67588b16..f3b484c99789 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h @@ -388,16 +388,6 @@ static inline int backlight_disable(struct backlight_device *bd) return backlight_update_status(bd); } -/** - * backlight_put - Drop backlight reference - * @bd: the backlight device to put - */ -static inline void backlight_put(struct backlight_device *bd) -{ - if (bd) - put_device(&bd->dev); -} - /** * backlight_is_blank - Return true if display is expected to be blank * @bd: the backlight device -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH v5 08/19] backlight: remove the unused backlight_bl driver
The backlight_bl driver required initialization using struct generic_bl_info. As there are no more references to this struct there is no users left. So it is safe to delete the driver. Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/Kconfig | 8 -- drivers/video/backlight/Makefile | 1 - drivers/video/backlight/generic_bl.c | 110 --- include/linux/backlight.h| 9 --- 4 files changed, 128 deletions(-) delete mode 100644 drivers/video/backlight/generic_bl.c diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig index 95c546cc8774..87f9fc238d28 100644 --- a/drivers/video/backlight/Kconfig +++ b/drivers/video/backlight/Kconfig @@ -173,14 +173,6 @@ config BACKLIGHT_EP93XX To compile this driver as a module, choose M here: the module will be called ep93xx_bl. -config BACKLIGHT_GENERIC - tristate "Generic (aka Sharp Corgi) Backlight Driver" - default y - help - Say y to enable the generic platform backlight driver previously - known as the Corgi backlight driver. If you have a Sharp Zaurus - SL-C7xx, SL-Cxx00 or SL-6000x say y. - config BACKLIGHT_IPAQ_MICRO tristate "iPAQ microcontroller backlight driver" depends on MFD_IPAQ_MICRO diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile index 2072d21b60f7..13463b99f1f9 100644 --- a/drivers/video/backlight/Makefile +++ b/drivers/video/backlight/Makefile @@ -31,7 +31,6 @@ obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o obj-$(CONFIG_BACKLIGHT_DA903X) += da903x_bl.o obj-$(CONFIG_BACKLIGHT_DA9052) += da9052_bl.o obj-$(CONFIG_BACKLIGHT_EP93XX) += ep93xx_bl.o -obj-$(CONFIG_BACKLIGHT_GENERIC)+= generic_bl.o obj-$(CONFIG_BACKLIGHT_GPIO) += gpio_backlight.o obj-$(CONFIG_BACKLIGHT_HP680) += hp680_bl.o obj-$(CONFIG_BACKLIGHT_HP700) += jornada720_bl.o diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c deleted file mode 100644 index 8fe63dbc8590.. --- a/drivers/video/backlight/generic_bl.c +++ /dev/null @@ -1,110 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Generic Backlight Driver - * - * Copyright (c) 2004-2008 Richard Purdie - */ - -#include -#include -#include -#include -#include -#include -#include - -static int genericbl_intensity; -static struct backlight_device *generic_backlight_device; -static struct generic_bl_info *bl_machinfo; - -static int genericbl_send_intensity(struct backlight_device *bd) -{ - int intensity = bd->props.brightness; - - if (bd->props.power != FB_BLANK_UNBLANK) - intensity = 0; - if (bd->props.state & BL_CORE_FBBLANK) - intensity = 0; - if (bd->props.state & BL_CORE_SUSPENDED) - intensity = 0; - - bl_machinfo->set_bl_intensity(intensity); - - genericbl_intensity = intensity; - - if (bl_machinfo->kick_battery) - bl_machinfo->kick_battery(); - - return 0; -} - -static int genericbl_get_intensity(struct backlight_device *bd) -{ - return genericbl_intensity; -} - -static const struct backlight_ops genericbl_ops = { - .options = BL_CORE_SUSPENDRESUME, - .get_brightness = genericbl_get_intensity, - .update_status = genericbl_send_intensity, -}; - -static int genericbl_probe(struct platform_device *pdev) -{ - struct backlight_properties props; - struct generic_bl_info *machinfo = dev_get_platdata(&pdev->dev); - const char *name = "generic-bl"; - struct backlight_device *bd; - - bl_machinfo = machinfo; - if (!machinfo->limit_mask) - machinfo->limit_mask = -1; - - if (machinfo->name) - name = machinfo->name; - - memset(&props, 0, sizeof(struct backlight_properties)); - props.type = BACKLIGHT_RAW; - props.max_brightness = machinfo->max_intensity; - bd = devm_backlight_device_register(&pdev->dev, name, &pdev->dev, - NULL, &genericbl_ops, &props); - if (IS_ERR(bd)) - return PTR_ERR(bd); - - platform_set_drvdata(pdev, bd); - - bd->props.power = FB_BLANK_UNBLANK; - bd->props.brightness = machinfo->default_intensity; - backlight_update_status(bd); - - generic_backlight_device = bd; - - dev_info(&pdev->dev, "Generic Backlight Driver Initialized.\n"); - return 0; -} - -static int genericbl_remove(struct platform_device *pdev) -{ - struct backlight_device *bd = platform_get_drvdata(pdev); - - bd->props.power = 0; - bd->props.brightness = 0; - backlight_update_status(bd); - - dev_info(&pdev->dev, "Generic Backlight Driver Unloaded\n"); - return 0; -} - -static struc
[PATCH v5 10/19] backlight: add overview and update existing doc
Add overview chapter to backlight.c. Update existing kernel-doc to follow a more consistent style and drop kernel-doc for deprecated functions. v4: - Include updated devm_of_find_backlight doc (was accidently included in a later patch) v3: - Updated a few editorial details (Daniel) v2: - Sevaral editorial corrections that makes reading much easier (Daniel) - Spelling fixes (Daniel) - updated intro chapter with a little more info Signed-off-by: Sam Ravnborg Reviewed-by: Daniel Thompson Reviewed-by: Emil Velikov Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/backlight.c | 140 +++- 1 file changed, 98 insertions(+), 42 deletions(-) diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 18501956dd87..93ae8c63fe4c 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -22,6 +22,47 @@ #include #endif +/** + * DOC: overview + * + * The backlight core supports implementing backlight drivers. + * + * A backlight driver registers a driver using + * devm_backlight_device_register(). The properties of the backlight + * driver such as type and max_brightness must be specified. + * When the core detect changes in for example brightness or power state + * the update_status() operation is called. The backlight driver shall + * implement this operation and use it to adjust backlight. + * + * Several sysfs attributes are provided by the backlight core:: + * + * - brightness R/W, set the requested brightness level + * - actual_brighness RO, the brightness level used by the HW + * - max_brightness RO, the maximum brightness level supported + * + * See Documentation/ABI/stable/sysfs-class-backlight for the full list. + * + * The backlight can be adjusted using the sysfs interface, and + * the backlight driver may also support adjusting backlight using + * a hot-key or some other platfrom or firmware specific way. + * + * The driver must implement the get_brightness() operation if + * the HW do not support all the levels that can be specified in + * brightness, thus providing user-space access to the actual level + * via the actual_brightness attribute. + * + * When the backlight changes this is reported to user-space using + * an uevent connected to the actual_brightness attribute. + * When brightness is set by platform specific means, for example + * a hot-key to adjust backlight, the driver must notify the backlight + * core that brightness has changed using backlight_force_update(). + * + * The backlight driver core receives notifications from fbdev and + * if the event is FB_EVENT_BLANK and if the value of blank, from the + * FBIOBLANK ioclt, results in a change in the backlight state the + * update_status() operation is called. + */ + static struct list_head backlight_dev_list; static struct mutex backlight_dev_list_mutex; static struct blocking_notifier_head backlight_notifier; @@ -40,9 +81,17 @@ static const char *const backlight_scale_types[] = { #if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \ defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)) -/* This callback gets called when something important happens inside a - * framebuffer driver. We're looking if that important event is blanking, - * and if it is and necessary, we're switching backlight power as well ... +/* + * fb_notifier_callback + * + * This callback gets called when something important happens inside a + * framebuffer driver. The backlight core only cares about FB_BLANK_UNBLANK + * which is reported to the driver using backlight_update_status() + * as a state change. + * + * There may be several fbdev's connected to the backlight device, + * in which case they are kept track of. A state change is only reported + * if there is a change in backlight for the specified fbdev. */ static int fb_notifier_callback(struct notifier_block *self, unsigned long event, void *data) @@ -324,7 +373,10 @@ ATTRIBUTE_GROUPS(bl_device); * @reason: reason for update * * Updates the internal state of the backlight in response to a hardware event, - * and generate a uevent to notify userspace + * and generates an uevent to notify userspace. A backlight driver shall call + * backlight_force_update() when the backlight is changed using, for example, + * a hot-key. The updated brightness is read using get_brightness() and the + * brightness value is reported using an uevent. */ void backlight_force_update(struct backlight_device *bd, enum backlight_update_reason reason) @@ -337,20 +389,7 @@ void backlight_force_update(struct backlight_device *bd, } EXPORT_SYMBOL(backlight_force_update); -/** - * backlight_device_register - create and register a new object of - * backlight_device class. - * @name: the name of the new object(must be the same as the name of the - * respective framebuffer de
[PATCH v5 14/19] backlight: cr_bllcd: introduce gpio-backlight semantics
cr_bllcd can turn backlight ON or OFF. Fix semantitics so they equals what we know from gpio-backlight. brightness == 0 => backlight off brightness == 1 => backlight on Use the backlight_get_brightness() helper to simplify the code. v2: - reworked to introduce gpio-backlight semantics (Daniel) Signed-off-by: Sam Ravnborg Cc: Lee Jones Cc: Daniel Thompson Cc: Jingoo Han --- drivers/video/backlight/cr_bllcd.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c index 4624b7b7c6a6..a24d42e1ea3c 100644 --- a/drivers/video/backlight/cr_bllcd.c +++ b/drivers/video/backlight/cr_bllcd.c @@ -63,22 +63,15 @@ static int cr_backlight_set_intensity(struct backlight_device *bd) u32 addr = gpio_bar + CRVML_PANEL_PORT; u32 cur = inl(addr); - if (bd->props.power == FB_BLANK_UNBLANK) - intensity = FB_BLANK_UNBLANK; - if (bd->props.fb_blank == FB_BLANK_UNBLANK) - intensity = FB_BLANK_UNBLANK; - if (bd->props.power == FB_BLANK_POWERDOWN) - intensity = FB_BLANK_POWERDOWN; - if (bd->props.fb_blank == FB_BLANK_POWERDOWN) - intensity = FB_BLANK_POWERDOWN; - - if (intensity == FB_BLANK_UNBLANK) { /* FULL ON */ - cur &= ~CRVML_BACKLIGHT_OFF; - outl(cur, addr); - } else if (intensity == FB_BLANK_POWERDOWN) { /* OFF */ + if (backlight_get_brightness(bd) == 0) { + /* OFF */ cur |= CRVML_BACKLIGHT_OFF; outl(cur, addr); - } /* anything else, don't bother */ + } else { + /* FULL ON */ + cur &= ~CRVML_BACKLIGHT_OFF; + outl(cur, addr); + } return 0; } @@ -90,9 +83,9 @@ static int cr_backlight_get_intensity(struct backlight_device *bd) u8 intensity; if (cur & CRVML_BACKLIGHT_OFF) - intensity = FB_BLANK_POWERDOWN; + intensity = 0; else - intensity = FB_BLANK_UNBLANK; + intensity = 1; return intensity; } -- 2.25.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/ingenic: Silence uninitialized-variable warning
Hi Paul. On Sun, Jul 19, 2020 at 11:38:34AM +0200, Paul Cercueil wrote: > Silence compiler warning about used but uninitialized 'ipu_state' > variable. In practice, the variable would never be used when > uninitialized, but the compiler cannot know that 'priv->ipu_plane' will > always be NULL if CONFIG_INGENIC_IPU is disabled. > > Silence the warning by initializing the value to NULL. > > Signed-off-by: Paul Cercueil Patch looks good. Had to dig into the code to understand the change to the no_vblank flag. So: Reviewed-by: Sam Ravnborg I expect you to commit the patch. Looking at the code I noticed that the return value of drm_atomic_get_plane_state() is not checked. Can you try to look into this. Sam > --- > drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > index b6d946fbeaf5..ada990a7f911 100644 > --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c > @@ -198,7 +198,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc > *crtc, >struct drm_crtc_state *state) > { > struct ingenic_drm *priv = drm_crtc_get_priv(crtc); > - struct drm_plane_state *f1_state, *f0_state, *ipu_state; > + struct drm_plane_state *f1_state, *f0_state, *ipu_state = NULL; > long rate; > > if (!drm_atomic_crtc_needs_modeset(state)) > @@ -229,7 +229,7 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc > *crtc, > > /* If all the planes are disabled, we won't get a VBLANK IRQ */ > priv->no_vblank = !f1_state->fb && !f0_state->fb && > - !(priv->ipu_plane && ipu_state->fb); > + !(ipu_state && ipu_state->fb); > } > > return 0; > -- > 2.27.0 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/lima: fix wait pp reset timeout
On Sun, Jul 19, 2020 at 9:31 AM Qiang Yu wrote: > > PP bcast is marked as doing async reset after job is done. > When resume after suspend, each PP is reset individually, > so no need to reset in PP bcast resume. But I forgot to > clear the PP bcast async reset mark so call into async wait > before job run and gets timeout. > > Fixes: 3446d7e9883d ("drm/lima: add resume/suspend callback for each ip") > Signed-off-by: Qiang Yu > --- > drivers/gpu/drm/lima/lima_pp.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c > index 33f01383409c..a5c95bed08c0 100644 > --- a/drivers/gpu/drm/lima/lima_pp.c > +++ b/drivers/gpu/drm/lima/lima_pp.c > @@ -271,6 +271,8 @@ void lima_pp_fini(struct lima_ip *ip) > > int lima_pp_bcast_resume(struct lima_ip *ip) > { > + /* PP has been reset by individual PP resume */ > + ip->data.async_reset = false; > return 0; > } > > -- Reviewed-by: Erico Nunes This fixes the issue reported at https://gitlab.freedesktop.org/lima/linux/-/issues/34 . ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v1 1/1] drm/bridge: nwl-dsi: Drop DRM_BRIDGE_ATTACH_NO_CONNECTOR check.
Hi Guido. On Sat, Jul 18, 2020 at 08:26:37PM +0200, Guido Günther wrote: > We don't create a connector but let panel_bridge handle that so there's > no point in rejecting DRM_BRIDGE_ATTACH_NO_CONNECTOR. > > Signed-off-by: Guido Günther Looks good and correct. Reviewed-by: Sam Ravnborg If there is no other feedback I will apply within a few days. Ping me if I forget it. Sam > --- > drivers/gpu/drm/bridge/nwl-dsi.c | 5 - > 1 file changed, 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/nwl-dsi.c > b/drivers/gpu/drm/bridge/nwl-dsi.c > index 77a79af70914..ce94f797d090 100644 > --- a/drivers/gpu/drm/bridge/nwl-dsi.c > +++ b/drivers/gpu/drm/bridge/nwl-dsi.c > @@ -918,11 +918,6 @@ static int nwl_dsi_bridge_attach(struct drm_bridge > *bridge, > struct drm_panel *panel; > int ret; > > - if (flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR) { > - DRM_ERROR("Fix bridge driver to make connector optional!"); > - return -EINVAL; > - } > - > ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, 0, &panel, > &panel_bridge); > if (ret) > -- > 2.26.2 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 208611] New: amdgpu crash on sharing image memory between Vulkan and OpenGL
https://bugzilla.kernel.org/show_bug.cgi?id=208611 Bug ID: 208611 Summary: amdgpu crash on sharing image memory between Vulkan and OpenGL Product: Drivers Version: 2.5 Kernel Version: 5.7.8-200.fc32.x86_64 Hardware: x86-64 OS: Linux Tree: Mainline Status: NEW Severity: normal Priority: P1 Component: Video(DRI - non Intel) Assignee: drivers_video-...@kernel-bugs.osdl.org Reporter: yalt...@gmail.com Regression: No Created attachment 290347 --> https://bugzilla.kernel.org/attachment.cgi?id=290347&action=edit The kernel crash part of the log. I have two programs: one (Vulkan) creates an image, allocates memory for it and exports the memory as an fd. The second program (OpenGL) receives the fd, imports it as a memory for a texture, and blits some data into the texture. The Vulkan program subsequently maps the memory and reads pixel values from it. Both programs follow the code of this ANGLE test for Vulkan-OpenGL interop very closely: https://github.com/pmatos/WebKit/blob/c42c49d3859ceb5d6e5c502373c8d3e371662ac4/Source/ThirdParty/ANGLE/src/tests/gl_tests/VulkanExternalImageTest.cpp#L434 It works fine with VK_FORMAT_R8G8B8A8_UNORM, but after changing it to R8G8B8_UNORM (without the alpha) in (I'm fairly certain) all respective places, I got corrupt image data on one run and a kernel crash on another run. Here are some excerpts from the log: amdgpu :01:00.0: GPU fault detected: 146 0x0f20880c for process vulkan-external pid 173502 thread vulkan-external pid 173502 amdgpu :01:00.0: VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x001005E4 amdgpu :01:00.0: VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x0608800C amdgpu :01:00.0: VM fault (0x0c, vmid 3, pasid 32784) at page 1050084, read from 'TC6' (0x54433600) (136) amdgpu :01:00.0: IH ring buffer overflow (0x0008AF70, 0x6660, 0xAF80) [drm] Fence fallback timer expired on ring sdma0 gmc_v8_0_process_interrupt: 305 callbacks suppressed amdgpu :01:00.0: GPU fault detected: 146 0x0e20480c for process vulkan-external pid 174193 thread vulkan-external pid 174193 amdgpu :01:00.0: VM_CONTEXT1_PROTECTION_FAULT_ADDR 0x001005C4 amdgpu :01:00.0: VM_CONTEXT1_PROTECTION_FAULT_STATUS 0x0A04800C amdgpu :01:00.0: VM fault (0x0c, vmid 5, pasid 32784) at page 1050052, read from 'TC4' (0x54433400) (72) [drm] Fence fallback timer expired on ring sdma0 [drm:drm_atomic_helper_wait_for_flip_done [drm_kms_helper]] *ERROR* [CRTC:49:crtc-1] flip_done timed out Full last part of the log attached. AMD RX 580, running Fedora 32 with GNOME Wayland. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
RE: [PATCH 2/8] drm/radeon: stop using TTM_MEMTYPE_FLAG_MAPPABLE
[AMD Public Use] -Original Message- From: Christian König Sent: Thursday, July 16, 2020 6:21 PM To: dri-devel@lists.freedesktop.org Cc: Chauhan, Madhav Subject: [PATCH 2/8] drm/radeon: stop using TTM_MEMTYPE_FLAG_MAPPABLE The driver doesn't expose any not-mapable memory resources. Looks like spell mistake in "mapable". Please check. Signed-off-by: Christian König --- drivers/gpu/drm/radeon/radeon_ttm.c | 13 - 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c index 54af06df865b..b474781a0920 100644 --- a/drivers/gpu/drm/radeon/radeon_ttm.c +++ b/drivers/gpu/drm/radeon/radeon_ttm.c @@ -76,7 +76,7 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, switch (type) { case TTM_PL_SYSTEM: /* System memory */ - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; + man->flags = 0; adev memory was set to zero while allocated and adev->mman.bdev used to fetch different mman. Do we need explicit initialization to '0'?? Regards, Madhav man->available_caching = TTM_PL_MASK_CACHING; man->default_caching = TTM_PL_FLAG_CACHED; break; @@ -84,7 +84,7 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, man->func = &ttm_bo_manager_func; man->available_caching = TTM_PL_MASK_CACHING; man->default_caching = TTM_PL_FLAG_CACHED; - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; + man->flags = 0; #if IS_ENABLED(CONFIG_AGP) if (rdev->flags & RADEON_IS_AGP) { if (!rdev->ddev->agp) { @@ -92,8 +92,6 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, (unsigned)type); return -EINVAL; } - if (!rdev->ddev->agp->cant_use_aperture) - man->flags = TTM_MEMTYPE_FLAG_MAPPABLE; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; @@ -103,8 +101,7 @@ static int radeon_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, case TTM_PL_VRAM: /* "On-card" video ram */ man->func = &ttm_bo_manager_func; - man->flags = TTM_MEMTYPE_FLAG_FIXED | -TTM_MEMTYPE_FLAG_MAPPABLE; + man->flags = TTM_MEMTYPE_FLAG_FIXED; man->available_caching = TTM_PL_FLAG_UNCACHED | TTM_PL_FLAG_WC; man->default_caching = TTM_PL_FLAG_WC; break; @@ -394,7 +391,6 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict, static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem) { - struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; struct radeon_device *rdev = radeon_get_rdev(bdev); mem->bus.addr = NULL; @@ -402,8 +398,7 @@ static int radeon_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_ mem->bus.size = mem->num_pages << PAGE_SHIFT; mem->bus.base = 0; mem->bus.is_iomem = false; - if (!(man->flags & TTM_MEMTYPE_FLAG_MAPPABLE)) - return -EINVAL; + switch (mem->mem_type) { case TTM_PL_SYSTEM: /* system memory */ -- 2.17.1 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 06/21] drm/bridge: tc358767: add drm_panel_bridge support
Hi Laurent. On Sat, Jul 11, 2020 at 01:19:35AM +0300, Laurent Pinchart wrote: > Hi Sam, > > Thank you for the patch. > > On Fri, Jul 03, 2020 at 09:24:02PM +0200, Sam Ravnborg wrote: > > Prepare the bridge driver for use in a chained setup by > > replacing direct use of drm_panel with drm_panel_bridge support. > > > > The bridge driver assume the panel is optional. > > The relevant tests are migrated over to check for the > > pnale bridge to keep the same functionality. > > s/pnale/panel/ > > > Note: the bridge panel will use the connector type from the panel. > > > > Signed-off-by: Sam Ravnborg > > Cc: Andrzej Hajda > > Cc: Neil Armstrong > > Cc: Laurent Pinchart > > Cc: Jonas Karlman > > Cc: Jernej Skrabec > > --- > > drivers/gpu/drm/bridge/tc358767.c | 57 +++ > > 1 file changed, 27 insertions(+), 30 deletions(-) > > > > diff --git a/drivers/gpu/drm/bridge/tc358767.c > > b/drivers/gpu/drm/bridge/tc358767.c > > index c2777b226c75..08d483664258 100644 > > --- a/drivers/gpu/drm/bridge/tc358767.c > > +++ b/drivers/gpu/drm/bridge/tc358767.c > > @@ -244,8 +244,8 @@ struct tc_data { > > struct drm_dp_aux aux; > > > > struct drm_bridge bridge; > > + struct drm_bridge *panel_bridge; > > struct drm_connectorconnector; > > - struct drm_panel*panel; > > > > /* link settings */ > > struct tc_edp_link link; > > @@ -1236,13 +1236,6 @@ static int tc_stream_disable(struct tc_data *tc) > > return 0; > > } > > > > -static void tc_bridge_pre_enable(struct drm_bridge *bridge) > > -{ > > - struct tc_data *tc = bridge_to_tc(bridge); > > - > > - drm_panel_prepare(tc->panel); > > -} > > - > > static void tc_bridge_enable(struct drm_bridge *bridge) > > { > > struct tc_data *tc = bridge_to_tc(bridge); > > @@ -1266,8 +1259,6 @@ static void tc_bridge_enable(struct drm_bridge > > *bridge) > > tc_main_link_disable(tc); > > return; > > } > > - > > - drm_panel_enable(tc->panel); > > } > > > > static void tc_bridge_disable(struct drm_bridge *bridge) > > @@ -1275,8 +1266,6 @@ static void tc_bridge_disable(struct drm_bridge > > *bridge) > > struct tc_data *tc = bridge_to_tc(bridge); > > int ret; > > > > - drm_panel_disable(tc->panel); > > - > > ret = tc_stream_disable(tc); > > if (ret < 0) > > dev_err(tc->dev, "main link stream stop error: %d\n", ret); > > @@ -1286,13 +1275,6 @@ static void tc_bridge_disable(struct drm_bridge > > *bridge) > > dev_err(tc->dev, "main link disable error: %d\n", ret); > > } > > > > -static void tc_bridge_post_disable(struct drm_bridge *bridge) > > -{ > > - struct tc_data *tc = bridge_to_tc(bridge); > > - > > - drm_panel_unprepare(tc->panel); > > -} > > - > > static bool tc_bridge_mode_fixup(struct drm_bridge *bridge, > > const struct drm_display_mode *mode, > > struct drm_display_mode *adj) > > @@ -1348,9 +1330,11 @@ static int tc_connector_get_modes(struct > > drm_connector *connector) > > return 0; > > } > > > > - count = drm_panel_get_modes(tc->panel, connector); > > - if (count > 0) > > - return count; > > + if (tc->panel_bridge) { > > + count = drm_bridge_get_modes(tc->panel_bridge, connector); > > + if (count > 0) > > + return count; > > + } > > > > edid = drm_get_edid(connector, &tc->aux.ddc); > > > > @@ -1378,7 +1362,7 @@ static enum drm_connector_status > > tc_connector_detect(struct drm_connector *conne > > int ret; > > > > if (tc->hpd_pin < 0) { > > - if (tc->panel) > > + if (tc->panel_bridge) > > return connector_status_connected; > > else > > return connector_status_unknown; > > @@ -1413,6 +1397,13 @@ static int tc_bridge_attach(struct drm_bridge > > *bridge, > > struct drm_device *drm = bridge->dev; > > int ret; > > > > + if (tc->panel_bridge) { > > + ret = drm_bridge_attach(tc->bridge.encoder, tc->panel_bridge, > > + &tc->bridge, flags); > > + if (ret < 0) > > + return ret; > > + } > > With this both this driver and the panel bridge driver will create a > connector. The simplest way to handle that is probably to pass > flags & ~DRM_BRIDGE_ATTACH_NO_CONNECTOR to drm_bridge_attach(). It's a > bit of a hack, but should go away once all users are converted to > !DRM_BRIDGE_ATTACH_NO_CONNECTOR. I do not follow you here - sorry. We have two situations: display driver creates the connector - and passes DRM_BRIDGE_ATTACH_NO_CONNECTOR. - bridge driver shall not create connector - bridge panel shall not create connector display driver expect bridge to create connector and passes 0 - bridge driver shall not create connector - bridge panel shall create connector So the correct logic se
Re: [PATCH] drm: hold gem reference until object is no longer accessed
Hi Steve. On Thu, Jul 16, 2020 at 10:29:52PM +0200, Sam Ravnborg wrote: > Hi Steve and others. > > On Fri, Jul 10, 2020 at 06:40:26PM -0400, Steve Cohen wrote: > > BUG: KASAN: use-after-free in drm_gem_open_ioctl > > > > There is potential for use-after-free here if the GEM object > > handle is closed between the idr lookup and retrieving the size > > from the object since a local reference is not being held at that > > point. Hold the local reference while the object can still be > > accessed to resolve this. > > > > Signed-off-by: Steve Cohen > > --- > > drivers/gpu/drm/drm_gem.c | 7 --- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c > > index 7bf628e..4b2891c 100644 > > --- a/drivers/gpu/drm/drm_gem.c > > +++ b/drivers/gpu/drm/drm_gem.c > > @@ -898,14 +898,15 @@ drm_gem_open_ioctl(struct drm_device *dev, void *data, > > > > /* drm_gem_handle_create_tail unlocks dev->object_name_lock. */ > > ret = drm_gem_handle_create_tail(file_priv, obj, &handle); > > - drm_gem_object_put_unlocked(obj); > > if (ret) > > - return ret; > > + goto out; > > > > args->handle = handle; > > args->size = obj->size; > > > > - return 0; > > +out: > > + drm_gem_object_put_unlocked(obj); > > + return ret; > > Lookign at drm_gem_flink_ioctl() that is implmented just above this > functions there are two things that I noted. > > 1) In drm_gem_flink_ioctl() the label is named "err:" - and my OCD likes > that similar labels have the same name. > > 2) The function takes the object_name_lock but fails to release it in > the error situation. Daniel pointed out on irc that drm_gem_handle_create_tail releases the lock. If I had read the comment I would have noticed too - sigh. With the label name fixed to "err:" like used in the function above: Reviewed-by: Sam Ravnborg Please re-submit. Sam > > Danile Vetter updated the locking in > 20228c447846da9399ead53fdbbc8ab69b47788a ("drm/gem: completely close gem_open > vs. gem_close races") > > but I failed to follow it all. > > Sam > > > } > > > > /** > > -- > > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > > a Linux Foundation Collaborative Project > > > > ___ > > dri-devel mailing list > > dri-devel@lists.freedesktop.org > > https://lists.freedesktop.org/mailman/listinfo/dri-devel > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 208611] amdgpu crash on sharing image memory between Vulkan and OpenGL
https://bugzilla.kernel.org/show_bug.cgi?id=208611 Alex Deucher (alexdeuc...@gmail.com) changed: What|Removed |Added CC||alexdeuc...@gmail.com --- Comment #1 from Alex Deucher (alexdeuc...@gmail.com) --- This is most likely a bug in mesa. The kernel driver is just the messenger. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 208611] amdgpu crash on sharing image memory between Vulkan and OpenGL
https://bugzilla.kernel.org/show_bug.cgi?id=208611 --- Comment #2 from Ivan Molodetskikh (yalt...@gmail.com) --- (In reply to Alex Deucher from comment #1) > This is most likely a bug in mesa. The kernel driver is just the messenger. I have opened a bug report in mesa: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3291 -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v5 0/4] Add LT9611 DSI to HDMI bridge
Hello, On 08-07-20, 16:05, Vinod Koul wrote: > Hi, > > This series adds driver and bindings for Lontium LT9611 bridge chip which > takes MIPI DSI as input and HDMI as output. > > This chip can be found in 96boards RB3 platform [1] commonly called DB845c. Any feedback on this series? > > [1]: https://www.96boards.org/product/rb3-platform/ > > Changes in v5: > - make symbol static, reported by kbuild-bot > > Changes in v4: > - Add msm/dsi patch to create connector and support > DRM_BRIDGE_ATTACH_NO_CONNECTOR > - Fix comments provided by Sam > > Changes in v3: > - fix kbuild reported error > - rebase on v5.8-rc1 > > Changes in v2: > - Add acks by Rob > - Fix comments reported by Emil and rename the file to lontium-lt9611.c > - Fix comments reported by Laurent on binding and driver > - Add HDMI audio support > > Vinod Koul (4): > dt-bindings: vendor-prefixes: Add Lontium vendor prefix > dt-bindings: display: bridge: Add documentation for LT9611 > drm/bridge: Introduce LT9611 DSI to HDMI bridge > drm/msm/dsi: attach external bridge with > DRM_BRIDGE_ATTACH_NO_CONNECTOR > > .../display/bridge/lontium,lt9611.yaml| 176 +++ > .../devicetree/bindings/vendor-prefixes.yaml |2 + > drivers/gpu/drm/bridge/Kconfig| 13 + > drivers/gpu/drm/bridge/Makefile |1 + > drivers/gpu/drm/bridge/lontium-lt9611.c | 1142 + > drivers/gpu/drm/msm/dsi/dsi.c |7 +- > drivers/gpu/drm/msm/dsi/dsi_manager.c | 27 +- > 7 files changed, 1348 insertions(+), 20 deletions(-) > create mode 100644 > Documentation/devicetree/bindings/display/bridge/lontium,lt9611.yaml > create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c > > -- > 2.26.2 -- ~Vinod ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge
Hi Vinod. Three trivial points below. The rest looks good. With these fixed you can add: Reviewed-by: Sam Ravnborg Sam On Wed, Jul 08, 2020 at 04:05:58PM +0530, Vinod Koul wrote: > Lontium Lt9611 is a DSI to HDMI bridge which supports two DSI ports and > I2S port as an input and HDMI port as output > > Co-developed-by: Bjorn Andersson > Signed-off-by: Bjorn Andersson > Co-developed-by: Srinivas Kandagatla > Signed-off-by: Srinivas Kandagatla > Tested-by: John Stultz > Signed-off-by: Vinod Koul > --- > drivers/gpu/drm/bridge/Kconfig | 13 + > drivers/gpu/drm/bridge/Makefile |1 + > drivers/gpu/drm/bridge/lontium-lt9611.c | 1142 +++ > 3 files changed, 1156 insertions(+) > create mode 100644 drivers/gpu/drm/bridge/lontium-lt9611.c > > + > +#include > +#include > +#include > +#include > +#include In alphabetical order. drm_probe_helper needs to be moved. > + > +#define EDID_SEG_SIZE256 > +#define EDID_LEN 32 > +#define EDID_LOOP8 > +#define KEY_DDC_ACCS_DONE 0x02 > +#define DDC_NO_ACK 0x50 > + > +static void lt9611_pcr_setup(struct lt9611 *lt9611, const struct > drm_display_mode *mode) > +{ > + const struct reg_sequence reg_cfg[] = { > + { 0x830b, 0x01 }, > + { 0x830c, 0x10 }, > + { 0x8348, 0x00 }, > + { 0x8349, 0x81 }, > + > + /* stage 1 */ > + { 0x8321, 0x4a }, > + { 0x8324, 0x71 }, > + { 0x8325, 0x30 }, > + { 0x832a, 0x01 }, > + > + /* stage 2 */ > + { 0x834a, 0x40 }, > + { 0x831d, 0x10 }, > + > + /* MK limit */ > + { 0x832d, 0x38 }, > + { 0x8331, 0x08 }, > + }; > + const struct reg_sequence reg_cfg2[] = { > + { 0x830b, 0x03 }, > + { 0x830c, 0xd0 }, > + { 0x8348, 0x03 }, > + { 0x8349, 0xe0 }, > + { 0x8324, 0x72 }, > + { 0x8325, 0x00 }, > + { 0x832a, 0x01 }, > + { 0x834a, 0x10 }, > + { 0x831d, 0x10 }, > + { 0x8326, 0x37 }, Block above is indented one tab too much. > +static int lt9611_bridge_attach(struct drm_bridge *bridge, > + enum drm_bridge_attach_flags flags) > +{ > + struct lt9611 *lt9611 = bridge_to_lt9611(bridge); > + int ret; > + > + if (!(flags & DRM_BRIDGE_ATTACH_NO_CONNECTOR)) { > + dev_err(lt9611->dev, "Fix bridge driver to make connector > optional!"); > + return -EINVAL; > + } This should say that the display driver should be fixed. If a display driver expects this bridge to create the connector it would not work. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] RFC: ACPI / OSI: remove workarounds for hybrid graphics laptops
On Fri, Jul 17, 2020 at 9:52 PM Alex Hung wrote: > > On 2020-07-17 1:05 p.m., Karol Herbst wrote: > > It's hard to figure out what systems are actually affected and right now I > > don't see a good way of removing those... > > > > But I'd like to see thos getting removed and drivers fixed instead (which > > happened at least for nouveau). > > > > And as mentioned before, I prefer people working on fixing issues instead > > of spending time to add firmware level workarounds which are hard to know > > to which systems they apply to, hard to remove and basically a big huge > > pain to work with.> In the end I have no idea how to even figure out what > > systems are affected > > and which not by this, so I have no idea how to even verify we can safely > > remove this (which just means those are impossible to remove unless we risk > > breaking systems, which again makes those supper annoying to deal with). > > > > Also from the comments it's hard to get what those bits really do. Are they > > just preventing runtime pm or do the devices are powered down when booting? > > I am sure it's the former, still... > > > > Please, don't do this again. > > > > For now, those workaround prevent power savings on systems those workaround > > applies to, which might be any so those should get removed asap and if > > new issues arrise removing those please do a proper bug report and we can > > look into it and come up with a proper fix (and keep this patch out until > > we resolve all of those). > > > > Signed-off-by: Karol Herbst > > CC: Alex Hung > > CC: "Rafael J. Wysocki" > > CC: Len Brown > > CC: Lyude Paul > > CC: linux-ker...@vger.kernel.org > > CC: dri-devel@lists.freedesktop.org > > CC: nouv...@lists.freedesktop.org > > --- > > drivers/acpi/osi.c | 24 > > 1 file changed, 24 deletions(-) > > > > diff --git a/drivers/acpi/osi.c b/drivers/acpi/osi.c > > index 9f68538091384..d4405e1ca9b97 100644 > > --- a/drivers/acpi/osi.c > > +++ b/drivers/acpi/osi.c > > @@ -44,30 +44,6 @@ osi_setup_entries[OSI_STRING_ENTRIES_MAX] __initdata = { > > {"Processor Device", true}, > > {"3.0 _SCP Extensions", true}, > > {"Processor Aggregator Device", true}, > > - /* > > - * Linux-Dell-Video is used by BIOS to disable RTD3 for NVidia > > graphics > > - * cards as RTD3 is not supported by drivers now. Systems with NVidia > > - * cards will hang without RTD3 disabled. > > - * > > - * Once NVidia drivers officially support RTD3, this _OSI strings can > > - * be removed if both new and old graphics cards are supported. > > - */ > > - {"Linux-Dell-Video", true}, > > - /* > > - * Linux-Lenovo-NV-HDMI-Audio is used by BIOS to power on NVidia's > > HDMI > > - * audio device which is turned off for power-saving in Windows OS. > > - * This power management feature observed on some Lenovo Thinkpad > > - * systems which will not be able to output audio via HDMI without > > - * a BIOS workaround. > > - */ > > - {"Linux-Lenovo-NV-HDMI-Audio", true}, > > - /* > > - * Linux-HPI-Hybrid-Graphics is used by BIOS to enable dGPU to > > - * output video directly to external monitors on HP Inc. mobile > > - * workstations as Nvidia and AMD VGA drivers provide limited > > - * hybrid graphics supports. > > - */ > > - {"Linux-HPI-Hybrid-Graphics", true}, > > }; > > > > static u32 acpi_osi_handler(acpi_string interface, u32 supported) > > > > The changes were discussed and tested a while ago, and no crashes were > observed. Thanks for solving PM issues in nouveau. > > Acked-by: Alex Hung > By any chance, do you have a list of systems implementing those workarounds? ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/nouveau: Accept 'legacy' format modifiers
On Sat, Jul 18, 2020 at 5:43 AM James Jones wrote: > > On 7/17/20 12:47 PM, Daniel Vetter wrote: > > On Fri, Jul 17, 2020 at 11:57:57AM -0700, James Jones wrote: > >> Accept the DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK() > >> family of modifiers to handle broken userspace > >> Xorg modesetting and Mesa drivers. > >> > >> Tested with Xorg 1.20 modesetting driver, > >> weston@c46c70dac84a4b3030cd05b380f9f410536690fc, > >> gnome & KDE wayland desktops from Ubuntu 18.04, > >> and sway 1.5 > > > > Just bikeshed, but maybe a few more words on what exactly is broken and > > how this works around it. Specifically why we only accept these, but don't > > advertise them. > > Added quite a few words. > > >> > >> Signed-off-by: James Jones > > > > Needs Fixes: line here. Also nice to mention the bug reporter/link. > > Done in v2. > > >> --- > >> drivers/gpu/drm/nouveau/nouveau_display.c | 26 +-- > >> 1 file changed, 24 insertions(+), 2 deletions(-) > >> > >> diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c > >> b/drivers/gpu/drm/nouveau/nouveau_display.c > >> index 496c4621cc78..31543086254b 100644 > >> --- a/drivers/gpu/drm/nouveau/nouveau_display.c > >> +++ b/drivers/gpu/drm/nouveau/nouveau_display.c > >> @@ -191,8 +191,14 @@ nouveau_decode_mod(struct nouveau_drm *drm, > >> uint32_t *tile_mode, > >> uint8_t *kind) > >> { > >> +struct nouveau_display *disp = nouveau_display(drm->dev); > >> BUG_ON(!tile_mode || !kind); > >> > >> +if ((modifier & (0xffull << 12)) == 0ull) { > >> +/* Legacy modifier. Translate to this device's 'kind.' */ > >> +modifier |= disp->format_modifiers[0] & (0xffull << 12); > >> +} > > > > Hm I tried to understand what this magic does by looking at drm_fourcc.h, > > but the drm_fourcc_canonicalize_nvidia_format_mod() in there implements > > something else. Is that function wrong, or should we use it here instead? > > > > Or is there something else going on entirely? > > This may be slightly clearer with the expanded change description: > > Canonicalize assumes the old modifiers are only used by certain Tegra > revisions, because the Mesa patches were supposed to land and obliterate > all uses beyond that. That assumption means it can assume the specific > page kind (0xfe) used by the display-engine-compatible layout on those > specific devices. There is no way to generally canonicalize a legacy > modifier without referencing a specific device type, as is indirectly > done here. > > This code does a limited device-specific canonicalization: It > substitutes the display-appropriate page kind used by this specific > device, ensuring we derive this correct page kind later in the function. > I iterated on the best way to accomplish this a few times, and this > was the least-invasive thing I came up with, but it does require a > pretty thorough understanding of the NVIDIA modifier macros. > > Thanks for the quick review. Ah yes this makes a ton more sense with your explanation of what's all going on. Thanks for all the explaining, but probably better if someone with real nouveau clues takes a look too. Fwiw (i.e. not much) Acked-by: Daniel Vetter Cheers, Daniel > > -James > > > > > Cheers, Daniel > > > >> + > >> if (modifier == DRM_FORMAT_MOD_LINEAR) { > >> /* tile_mode will not be used in this case */ > >> *tile_mode = 0; > >> @@ -227,6 +233,16 @@ nouveau_framebuffer_get_layout(struct drm_framebuffer > >> *fb, > >> } > >> } > >> > >> +static const u64 legacy_modifiers[] = { > >> +DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(0), > >> +DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(1), > >> +DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(2), > >> +DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(3), > >> +DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(4), > >> +DRM_FORMAT_MOD_NVIDIA_16BX2_BLOCK(5), > >> +DRM_FORMAT_MOD_INVALID > >> +}; > >> + > >> static int > >> nouveau_validate_decode_mod(struct nouveau_drm *drm, > >> uint64_t modifier, > >> @@ -247,8 +263,14 @@ nouveau_validate_decode_mod(struct nouveau_drm *drm, > >> (disp->format_modifiers[mod] != modifier); > >> mod++); > >> > >> -if (disp->format_modifiers[mod] == DRM_FORMAT_MOD_INVALID) > >> -return -EINVAL; > >> +if (disp->format_modifiers[mod] == DRM_FORMAT_MOD_INVALID) { > >> +for (mod = 0; > >> + (legacy_modifiers[mod] != DRM_FORMAT_MOD_INVALID) && > >> + (legacy_modifiers[mod] != modifier); > >> + mod++); > >> +if (legacy_modifiers[mod] == DRM_FORMAT_MOD_INVALID) > >> +return -EINVAL; > >> +} > >> > >> nouveau_decode_mod(drm, modifier, tile_mode, kind); > >> > >> -- > >> 2.17.1 > >> > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop
[Bug 208333] Black screen with Kernel 5.8 rc1/2/3/4 with Nvidia Gtx 760 driver nouveau
https://bugzilla.kernel.org/show_bug.cgi?id=208333 --- Comment #10 from Nathan Bryant (nbry...@optonline.net) --- Looks like they're working on it https://lists.freedesktop.org/archives/nouveau/2020-July/036264.html -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 208333] Black screen with Kernel 5.8 rc1/2/3/4 with Nvidia Gtx 760 driver nouveau
https://bugzilla.kernel.org/show_bug.cgi?id=208333 --- Comment #11 from Nathan Bryant (nbry...@optonline.net) --- Applied the patch (from Comment #10 above). Works for me. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH] drm/lima: fix wait pp reset timeout
Thanks, applied to drm-misc-fixes. Regards, Qiang On Sun, Jul 19, 2020 at 6:41 PM Erico Nunes wrote: > > On Sun, Jul 19, 2020 at 9:31 AM Qiang Yu wrote: > > > > PP bcast is marked as doing async reset after job is done. > > When resume after suspend, each PP is reset individually, > > so no need to reset in PP bcast resume. But I forgot to > > clear the PP bcast async reset mark so call into async wait > > before job run and gets timeout. > > > > Fixes: 3446d7e9883d ("drm/lima: add resume/suspend callback for each ip") > > Signed-off-by: Qiang Yu > > --- > > drivers/gpu/drm/lima/lima_pp.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/gpu/drm/lima/lima_pp.c b/drivers/gpu/drm/lima/lima_pp.c > > index 33f01383409c..a5c95bed08c0 100644 > > --- a/drivers/gpu/drm/lima/lima_pp.c > > +++ b/drivers/gpu/drm/lima/lima_pp.c > > @@ -271,6 +271,8 @@ void lima_pp_fini(struct lima_ip *ip) > > > > int lima_pp_bcast_resume(struct lima_ip *ip) > > { > > + /* PP has been reset by individual PP resume */ > > + ip->data.async_reset = false; > > return 0; > > } > > > > -- > > Reviewed-by: Erico Nunes > > This fixes the issue reported at > https://gitlab.freedesktop.org/lima/linux/-/issues/34 . ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[Bug 207383] [Regression] 5.7 amdgpu/polaris11 gpf: amdgpu_atomic_commit_tail
https://bugzilla.kernel.org/show_bug.cgi?id=207383 --- Comment #72 from Vinicius (mphant...@yahoo.com.br) --- Confirming that reverting 3202fa62f, cbfc35a48 and 89b83f282, fixed my polaris10 too. Tested with 5.7.8 and 5.7.9, Radeon RX 570. -- You are receiving this mail because: You are watching the assignee of the bug. ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH for v5.9] ARM: dts: mxs: Replace HTTP links with HTTPS ones
On Sun, Jul 19, 2020 at 12:10:08PM +0200, Alexander A. Klimov wrote: > Rationale: > Reduces attack surface on kernel devs opening the links for MITM > as HTTPS traffic is much harder to manipulate. > > Deterministic algorithm: > For each file: > If not .svg: > For each line: > If doesn't contain `\bxmlns\b`: > For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: > If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: > If both the HTTP and HTTPS versions > return 200 OK and serve the same content: > Replace HTTP with HTTPS. > > Signed-off-by: Alexander A. Klimov s/mxs/imx in the subject. Otherwise: Acked-by: Shawn Guo > --- > Continuing my work started at 93431e0607e5. > See also: git log --oneline '--author=Alexander A. Klimov > ' v5.7..master > (Actually letting a shell for loop submit all this stuff for me.) > > If there are any URLs to be removed completely > or at least not (just) HTTPSified: > Just clearly say so and I'll *undo my change*. > See also: https://lkml.org/lkml/2020/6/27/64 > > If there are any valid, but yet not changed URLs: > See: https://lkml.org/lkml/2020/6/26/837 > > If you apply the patch, please let me know. > > Sorry again to all maintainers who complained about subject lines. > Now I realized that you want an actually perfect prefixes, > not just subsystem ones. > I tried my best... > And yes, *I could* (at least half-)automate it. > Impossible is nothing! :) > > > arch/arm/boot/dts/imx23-pinfunc.h | 4 ++-- > arch/arm/boot/dts/imx28-pinfunc.h | 4 ++-- > arch/arm/boot/dts/imx53-tx53-x13x.dts | 4 ++-- > arch/arm/boot/dts/mxs-pinfunc.h | 4 ++-- > include/video/imx-ipu-v3.h| 4 ++-- > 5 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/arch/arm/boot/dts/imx23-pinfunc.h > b/arch/arm/boot/dts/imx23-pinfunc.h > index 5c0f32ca3a93..f9d7eb6679de 100644 > --- a/arch/arm/boot/dts/imx23-pinfunc.h > +++ b/arch/arm/boot/dts/imx23-pinfunc.h > @@ -7,8 +7,8 @@ > * License. You may obtain a copy of the GNU General Public License > * Version 2 at the following locations: > * > - * http://www.opensource.org/licenses/gpl-license.html > - * http://www.gnu.org/copyleft/gpl.html > + * https://www.opensource.org/licenses/gpl-license.html > + * https://www.gnu.org/copyleft/gpl.html > */ > > #ifndef __DT_BINDINGS_MX23_PINCTRL_H__ > diff --git a/arch/arm/boot/dts/imx28-pinfunc.h > b/arch/arm/boot/dts/imx28-pinfunc.h > index e11f69ba0fe4..ffd5412b70ae 100644 > --- a/arch/arm/boot/dts/imx28-pinfunc.h > +++ b/arch/arm/boot/dts/imx28-pinfunc.h > @@ -7,8 +7,8 @@ > * License. You may obtain a copy of the GNU General Public License > * Version 2 at the following locations: > * > - * http://www.opensource.org/licenses/gpl-license.html > - * http://www.gnu.org/copyleft/gpl.html > + * https://www.opensource.org/licenses/gpl-license.html > + * https://www.gnu.org/copyleft/gpl.html > */ > > #ifndef __DT_BINDINGS_MX28_PINCTRL_H__ > diff --git a/arch/arm/boot/dts/imx53-tx53-x13x.dts > b/arch/arm/boot/dts/imx53-tx53-x13x.dts > index 6cdf2082c742..a34d98cf6ed4 100644 > --- a/arch/arm/boot/dts/imx53-tx53-x13x.dts > +++ b/arch/arm/boot/dts/imx53-tx53-x13x.dts > @@ -41,8 +41,8 @@ > * License. You may obtain a copy of the GNU General Public License > * Version 2 at the following locations: > * > - * http://www.opensource.org/licenses/gpl-license.html > - * http://www.gnu.org/copyleft/gpl.html > + * https://www.opensource.org/licenses/gpl-license.html > + * https://www.gnu.org/copyleft/gpl.html > */ > > /dts-v1/; > diff --git a/arch/arm/boot/dts/mxs-pinfunc.h b/arch/arm/boot/dts/mxs-pinfunc.h > index c6da987b20cb..6766292eee30 100644 > --- a/arch/arm/boot/dts/mxs-pinfunc.h > +++ b/arch/arm/boot/dts/mxs-pinfunc.h > @@ -7,8 +7,8 @@ > * License. You may obtain a copy of the GNU General Public License > * Version 2 at the following locations: > * > - * http://www.opensource.org/licenses/gpl-license.html > - * http://www.gnu.org/copyleft/gpl.html > + * https://www.opensource.org/licenses/gpl-license.html > + * https://www.gnu.org/copyleft/gpl.html > */ > > #ifndef __DT_BINDINGS_MXS_PINCTRL_H__ > diff --git a/include/video/imx-ipu-v3.h b/include/video/imx-ipu-v3.h > index 06b0b57e996c..749490e3c66e 100644 > --- a/include/video/imx-ipu-v3.h > +++ b/include/video/imx-ipu-v3.h > @@ -5,8 +5,8 @@ > * Public License. You may obtain a copy of the GNU Lesser General > * Public License Version 2.1 or later at the following locations: > * > - * http://www.opensource.org/licenses/lgpl-license.html > - * http://www.gnu.org/copyleft/lgpl.html > + * https://www.opensource.org/licenses/lgpl-license.html > + * https://www.gnu.org/copyleft/lgpl.html > */ > > #ifndef __DRM_IPU_H__ > -- > 2.27.0 > ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dr
Re: [PATCH v5 3/4] drm/bridge: Introduce LT9611 DSI to HDMI bridge
Hi Sam, On 19-07-20, 19:18, Sam Ravnborg wrote: > Hi Vinod. > > Three trivial points below. > The rest looks good. > > With these fixed you can add: > Reviewed-by: Sam Ravnborg Thanks, I will send an update with nits fixed -- ~Vinod ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel